WatchOS code that used to work for background tasks requires the WKExtention.shared().delegate to be set to self, but now displays an error saying:
Cannot assign to property: 'delegate' is a get-only property
If I remove that line, I don't get updates when background tasks are triggered as I used to be able to receive before.
I have looked up and down StackOverflow and Google and Apple documentation and I can't find an answer. Why that line now shows an error when it used to work just fine.
Make a new WatchKit App and on the InterfaceControllerVC.swift
add WKExtensionDelegate to the class and:
override func awake(withContext context: Any?) {
super.awake(withContext: context)
WKExtension.shared().delegate = self
}
The line:
WKExtension.shared().delegate = self
is marked red and shows error as:
Cannot assign to property: 'delegate' is a get-only property