Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a view controller with a button that prints to the console #14

Merged
merged 1 commit into from
Mar 29, 2018

Conversation

LauraAubin
Copy link
Owner

@LauraAubin LauraAubin commented Mar 29, 2018

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:

  • It will default to 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 the ViewController class, this button therefore connects it's click action to the function:

 - (IBAction)ProcessButton:(id)sender;

@LauraAubin LauraAubin mentioned this pull request Mar 29, 2018
2 tasks
@LauraAubin LauraAubin merged commit 51f109a into master Mar 29, 2018
@LauraAubin LauraAubin deleted the create-a-button branch March 29, 2018 16:54
This was referenced Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant