watchkit - Customise title in the WK Status Bar -


i'm trying customise title in wk status bar of first controller.

enter image description here

the correct way should this:

public func settitle(title: string?) // title of controller. displayed when controller active 

so

wkinterfacecontroller.settitle("my title") 

but using code, xcode says cannot convert value of type 'string' expected argument type 'wkinterfacecontroller'. what's wrong?

settitle instance method, not class method.

you need refer specific instance controller change controller's title. since setting first controller's title within own code, can omit self, , call

settitle("my title") 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -