cs193p – Project #3 Assignment #3 Task #4

By Wing-Chi Poon (Own work) [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons

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.

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

2 thoughts on “cs193p – Project #3 Assignment #3 Task #4”

  1. buddy, good job with the assignment. I really appreciate it. your blog is helping me to verify whether I am on right track or not 🙂

    while you are making out solutions please do give explanation for these 3 tasks as they are the hardest part of the assignment to figure out and I hope it will be helpful to many more who visit your blog:

    1) If possible give a good explanation/Usage of contentScaleFactor in assignment. I have used the code as diff between bounds.min and origin divide by scale (the scale of the graph). But that will be points divides points per unit = unit. how to use contentScaleFactor and bring in pixels into picture rather than point ?
    2) How to make the origin centered to view when it rotates while preserving the previous origin value(coz upon launch the application will set layout and if we put the code of finding center of the view and setting it to origin there then everytime origin gets overriden. Then no point of saving the origin with NSUserDefaults as everytime the app launches it gets overriden by bounds.width/2 and bounds.height/2 value)
    3) How to use instruments and improve the overall performance. Since we are literally drawing the graph, everytime something changes , the app is very sluggish to gesture handlings and redrawing the stuff.

    1. … sorry, between the posts I have to earn some money 😉
      I promise I will address those questions, in the meantime you can have a look at the calculator assignment from the previous year. Though it was in Objective-C, the Swift-version will be pretty similar – at least conceptional.

Leave a Reply

Your email address will not be published. Required fields are marked *