How to open fb and instagram app by tapping on button in Swift

前端 未结 8 2426
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 03:17

How can I open Facebook and Instagram app by tapping on a button in swift? Some apps redirect to the Facebook app and open a specific page. How can I do the sam

8条回答
  •  春和景丽
    2020-11-30 03:38

    In swift5, use this

       guard let instagram = URL(string: "https://www.instagram.com/yourpagename") else { return }
       UIApplication.shared.open(instagram)
    

提交回复
热议问题