cs193p – Project #3 Assignment #3 Task #5

Please note, this blog entry is from a previous course. You might want to check out the current one.

On iPad and in landscape on iPhone 6+ devices, the graph must be (or be able to be) on screen at the same time as your existing Calculator’s user-interface (i.e. in a split view). On other iPhones the graph should “push” onto the screen via a navigation controller.

Add a split-view controller to story board and remove the two “generic” view controllers. Make the calculator view controller the root controller of the navigation view controller and the graph view controller detail-view controller of the split view controller. As last step embed the graph view controller inside another navigation view controller, and add a title for the calculator and graph view controllers:
Continue reading “cs193p – Project #3 Assignment #3 Task #5”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Project #3 Assignment #3 Task #4

Please note, this blog entry is from a previous course. You might want to check out the current one.

Neither of your MVCs in this assignment is allowed to have CalculatorBrain appear anywhere in its non-private API.

For now we have only the calculator view controller, make sure to make the calculator brain private:

    private var brain = CalculatorBrain()

The complete code for the task #4 is available on GitHub.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Project #3 Assignment #3 Task #3

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.

cs193p - Project #3 Assignment #3 Task #3 - Graph Button
cs193p – Project #3 Assignment #3 Task #3 – Graph Button

Continue reading “cs193p – Project #3 Assignment #3 Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Project #3 Assignment #3 Task #2

Please note, this blog entry is from a previous course. You might want to check out the current one.

Rename the ViewController class you’ve been working on in Assignments 1 and 2 to be CalculatorViewController.

Rename the filename, by selecting the filename and clicking one additional time:

cs193p - Project #3 Assignment #3 Task #2 - Rename Filename
cs193p – Project #3 Assignment #3 Task #2 – Rename Filename

Continue reading “cs193p – Project #3 Assignment #3 Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Project #3 Assignment #3 Task #1

Please note, this blog entry is from a previous course. You might want to check out the current one.

You must begin this assignment with your Assignment 2 code, not with any in-class demo code that has been posted. Learning to create new MVCs and segues requires experiencing it, not copy/pasting it or editing an existing storyboard that already has segues in it.

… cross my heart …

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #9 Scroll View and Multithreading

Please note, this blog entry is from a previous course. You might want to check out the current one.

The lecture starts with additional information on how to control the appearance of a view in different size classes and how to inspect constraints in various size classes.

Scroll Views

Adding sub views to a scroll view works similar like adding views to any other view. The only important difference is to define the content size of the scroll view:

scrollView.contentSize = CGSize(width: 3000, height: 2000)
logo.frame = CGRect(x: 2700, y: 50, width: 120, height: 180)
scrollView.addSubview(logo)
aerial.frame = CGRect(x: 150, y: 200, width: 2500, height: 1600)
scrollView.addSubview(aerial)

Continue reading “cs193p – Lecture #9 Scroll View and Multithreading”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail