Please note, this blog entry is from a previous course. You might want to check out the current one.
Add a new button to your calculator’s user-interface which, when touched, segues to a new MVC (that you will have to write) which graphs the program in the CalculatorBrain at the time the button was touched using the memory location M as the independent variable. For example, if the CalculatorBrain contains sin(M), you’d draw a sine wave. Subsequent input to the Calculator must have no effect on the graph (until the graphing button is touched again).
Currently we have not really space left to add another button. For now add the graph button in the top left corner – maybe we move it in the extra tasks later on – and add some sensible autolayout constraints.
… and for the fun of it, make it an image button. Add the needed images to the image assets and use them in storyboard:
Finally add a new class file for the graph-view controller to the project. Add a new view controller to storyboard and link it to the just created class. Create a segue (show detail) from the graph button to the new view controller and give it a sensible identifier. Because those steps do not really a lot change the background color of the view of the new view controller to see if actually something is happening when we click the button …
Further missing details from this tasks will be handled in the following tasks …
The complete code for the task #3 is available on GitHub.