I am creating my first WatchOS app as a companion to an iOS app.
The Watch App needs to be able to display a bingo ball whose number is sent from the phone. Since I can't overlay images with WatchOS, I've created 6 WKInterfaceControllers. One is the 'main' controller, and the other 5 each have a unique background image which is a bingo ball of the correct color (Blue, Red, Gray, Green and Yellow) and then I overlay a label with the ball letter and number (ie B14). I couldn't find a way to dynamically manipulate the background image of a single WKInterfaceController - but if there is a way to do so - I'd greatly appreciate a tip on how to do this and my other problem wouldn't exist.
Currently, I'm using WatchConnectivity from within the Main controller to receive updates from the phone. When the phone sends a number, the code determines the color it needs to be and then the following code presents the WKInterfaceController with the correct color background:
let nextName = "\(ballColor)Controller"
DispatchQueue.main.async {
self.presentController(withName: nextName, context: message)
WKInterfaceDevice().play(.click)
}
The problem I'm having is that once I activate the first color controller, I can't activate a different color controller without dismissing the currently active one.
So - how can I do this? I think I just need a way to hold a reference to the active controller so I can dismiss it before activating the one for the next ball - but I can't figure out how to do that.
I would appreciate it if someone could help point me in the right direction here…
Thanks in advance