I am learning how to create a companion Watch App for an iPhone app. (Everything is being done on the simulator)
I am sending a message when I tap a button on the Watch app.
session.sendMessage(["Message": "It Worked" ], replyHandler: nil) { (error) in
print(error)
}
Then I receive the message in ViewController.swift:
func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {
print(message["Message"])
print("!!!!")
theLabel.text = message["Message"] as! String
}
Neither print function fire. However I know I am getting the message because my label is being updated. Break points also don't work in this function. If I put another function call in the didRecieveMessage function it will fire.
Is this a bug? It made me think my message wasn't being sent for the longest time because I was just trying to see if the function was firing via print() and breakpoints.
If not a bug, why doesn't print() work?