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

7.1k views Asked by At

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)
        }
    }
}
1

There are 1 answers

1
Jeremy Huddleston Sequoia On BEST ANSWER

+[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.