Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'openParentApplication(_:reply:)' has been explicitly marked unavailable here - Xcode 7 Beta

After updating to Xcode 7 beta, I receive the following error message: "'openParentApplication(_:reply:)' has been explicitly marked unavailable here", when running the line of code "WKInterfaceController.openParentApplication"

Here is my actual code:

func getData(messageText: String) {
    let infoDictionary = ["message" : messageText]
    WKInterfaceController.openParentApplication(infoDictionary) {
        (replyDictionary, error) -> Void in

        if let castedResponseDictionary = replyDictionary as? [String: String],
            responseMessage = castedResponseDictionary["message"]
        {
            print(responseMessage)
        }
    }
}
like image 803
Aviv Avatar asked Jun 13 '15 16:06

Aviv


1 Answers

+[WKInterfaceController openParentApplication:] is only relevant for WatchKit1 app extensions because with WatchKit1 app extensions, the appex is running on the phone instead of on the watch.

With WatchKit2 app extensions, the appex is running on the watch, so actions such as this are less trivial to accomplish. You probably want to use -[WCSession sendMessageData:replyHandler:errorHandler:] from WatchConnectivity.framework for what you're doing.

like image 61
Jeremy Huddleston Sequoia Avatar answered Nov 06 '22 17:11

Jeremy Huddleston Sequoia