Search code examples
ioswatchkit

how to change arrow to say Back in watchkit OS2


I am using push segue based app for my Watch app. I want to change the back arrow to say the word "Back" instead. Is it possible?

I know it sounds silly but I have been googling for a while now. I thought I saw it somewhere how to change it but can't seem to find it anymore

enter image description here


Solution

  • in your interface controller:

    class MyInterfaceController: WKInterfaceController {
    
        override func awakeWithContext(context: AnyObject?) {
            setTitle("Back")
        }
    }
    

    The title shown up there is literally the title of the interface controller being presented.
    I understand that it could be confusing at first because in iOS, its the title of the previous view controller.

    You can also set it in the interface builder by double tapping that area of the interface :)