适用于Swift 3的解析入门套件

时间:2017-05-05 22:06:27

标签: swift facebook parse-platform swift3 parse-server

我已经下载了ParseStarterProject版本1.14.3,下载后它要求我转换为swift 3.之后给我一个错误:

Cannot convert value of type '(Bool, NSError?) -> ()' to expected argument type 'PFBooleanResultBlock?'

代码:

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    let installation = PFInstallation.current()
    installation?.setDeviceTokenFrom(deviceToken)
    installation?.saveInBackground()

    PFPush.subscribeToChannel(inBackground: "") { (succeeded: Bool, error: NSError?) in
        if succeeded {
            print("ParseStarterProject successfully subscribed to push notifications on the broadcast channel.\n")
        } else {
            print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.\n", error)
        }
    } as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock
}

我尝试用另一个线程(AppDelegate.swift function returning errors after converting to swift 3 (cannot convert to PFBooleanResultBlock?)?

解决

但是给了我这个错误:

 "Expected ) in the expression list"

http://imgur.com/nkdnEZp

0 个答案:

没有答案