URL Opening Swift App - Open Works - Called Function Does NOT work

后端 未结 2 1289
北恋
北恋 2020-12-19 06:43

Hello All – I am a newbie here ... trying to get my first iOS Swift (Xcode 11.2.1 / Swift 5 / iOS 13.2) app to open via URL and process the URL string. The app opens just f

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 07:17

    you need to use this function in your appDelegate

    func application(_ application: UIApplication, continue userActivity: NSUserActivity,
                         restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
            if let incomingURL = userActivity.webpageURL {
               print(incomingURL)
            }
            return false
    
    }
    

提交回复
热议问题