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

authentication - Mongodb revoke acccess to connect test database -

How to merge four videos on one screen with ffmpeg -

c - getting error: cannot take the address of an rvalue of type 'int' -