Unable to updated WKInterfaceController Title

While working with Xcode 11 and watchOS6 , I am unable to update WKInterfaceController Title text when controller is added in

reloadRootPageControllers, self.setTitle() get updated in willActivate() method only. After that when I programmatically update from button press it doesn't update. Though when we slightly slide the page, updated text appear. As not geting any method so slight scroll page so that updated value appear in title to resolve currently. Please also let me know is it bug that title is not updated, as if change is done after willActivate() shows up when page is slightly scroll. Above is working with watchOS5 sdk.

Replies

We are having the same issue

Same problem here. It works fine when you have only one page. More than one page and the title does not update

Which reloadRootControllers signature do you use ?


Doc states that reloadRootControllers(withNames:context:) and

reloadRootControllers(withNames:contexts:) are deprecated.


Replaced by reloadRootControllers(withNames:context:orientation:pageIndex:) and reloadRootControllers(withNames:contexts:orientation:pageIndex:)

or

reloadRootControllers(withNamesAndContext:) and

reloadRootControllers(withNamesAndContexts:)

Thanks, I am using

reloadRootPageControllers(withNames names: [String], contexts: [Any]?, orientation: WKPageOrientation, pageIndex: Int)
then also not working

Hello, I still see this issue. Did you find a solution? Did you file a bug report?

Workaround - override willActivate and call setTitle there. After setTitle is called in willActivate, setTitle will start working elsewhere in the program. I have a multi-page watch app with same issues described above.

Code Block
    // Bug with WatchKit, in order for the UI
    // to honor setTitle calls later in the
    // program, you need to call setTitle here first
    // Only need if you have multiple pages
    override func willActivate() {
        self.setTitle("")
        super.willActivate()
    }