From the course: Programming for Non-Programmers: iOS 16 and Swift 5

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Solution: Create methods for the equal button

Solution: Create methods for the equal button

(uplifting music) - [Instructor] Here is a solution to this chapter's challenge. I'm inside of Button Grid and then I'm going to create my equal was pressed method. So I'm going to copy and paste, the clear was pressed method and then just change clear to equal in both cases. Right there and right there. Then scroll up, find the equals button in your grid row and then add the action. So action after the comma and then set it equal to, equal was pressed. I'm again going to delete the parenthesis and the parameter name. And that's really it. At this point, you should be able to run the application and then click all the buttons and make sure that that print statement is running. So I'm going to press clear and then equals and then these mode buttons and then equals and clear. And let's see what we have inside of our output. Now I don't see anything right here and that's because this area that shows those print…

Contents