Welcome to the Treehouse Community
Looking to learn something new?
nil target and action? [Resolved]
I managed to get through task 1 of 2 with this code added to "enums.swift":
let done = Button.Done("Done")
..but I have really no idea what type of code is needed for task 2 of 2...?
Was there a swift course that described in detail all about target and action?
A quick google search turned up this old Treehouse blog post (but I think it's pre-Swift):
I remember there was a "target-Action link in the Teacher's notes for the Build a Simple iPhone App with Swift course (but of course who ever bothers to click through links in Teacher's Notes ):
I did find this stackoverflow thread that might be related (shows assigning both target and action):
It says the question asked in that thread has to do with this other stackoverflow thread which talks about selectors:
Maybe the answer can be found by understanding the answers given in those two stackoverflow threads,
but I certainly didn't see how its related to the 'func color()' code in the "Methods on Enumerations" video:
Also (just for cross reference) there is a related forum thread about that 'func color()' code (which is in the 'SwiftEnumsOptionals-S2' download for the course):
There seems to be some documentation to the actual (real) UIStatusBarStyle enumerations ('BlackOpaque', 'BlackTranslucent', 'Default', and 'LightContent') here: