Create a view controller with a button that prints to the console #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this do?
Part of #13
This creates a button that prints to the console when clicked. This also creates a view controller class.
How is this accomplished?
Button prototyping:
I created a push button on the canvas, then dragged it over to the
ViewController
header file. This automatically created a function prototype.View Controller object:
I created a
View Controller
object, and used the view controller class:NSObject
if you don't explicitly set this:Button action connection:
On the button, you should see an action that connects this button to the
View Controller
object.Since the
View Controller
object connects to theViewController
class, this button therefore connects it's click action to the function: