Thursday 15 April 2010

Difference between UIButton! and UIButton? in swift IOS -



Difference between UIButton! and UIButton? in swift IOS -

now start working swift language. have initialize button follows

@iboutlet weak var systemtextbutton: uibutton!

after can set title using .settitle() property.

if utilize ? instead of ! while initialize showing error on .settitle()

uibutton? not have fellow member named 'settitle'

so, please tell me difference between uibutton! , uibutton? .

both of them optional types. uibutton! implicitly unwrapping optional type. don't have disclose manually. take not app crash if seek access value of uibutton! while nil.

for more info read "implicitly unwrapped optionals" section in apple's "the swift programming language" book.

ios swift uibutton

No comments:

Post a Comment