第三方应用都定义了不同的URL Scheme, 通过UIApplication.shared.open()方法打开URL Scheme,即可跳转到对应的App

let SchemeUrl = "snssdk1128://search/trending"
    if let url = URL(string: SchemeUrl) {
        if #available(iOS 10, *) {
            UIApplication.shared.open(url, options: [:],
                                      completionHandler: {
                                        (success) in
            })
        } else {
            UIApplication.shared.openURL(url)
        }
    }

Swift

添加新评论