Please note, this blog entry is from a previous course. You might want to check out the current one.
Do not change any non-private API in CalculatorBrain and continue to use an enum as its primary internal data structure.
… promise to do that!
cs193p assignment solutions et al
for the iPhone-Application-Development Course from Stanford University et al
Please note, this blog entry is from a previous course. You might want to check out the current one.
Do not change any non-private API in CalculatorBrain and continue to use an enum as its primary internal data structure.
… promise to do that!
Please note, this blog entry is from a previous course. You might want to check out the current one.
All of the changes to the Calculator made in lecture must be applied to your Assignment 1. Get this fully functioning before proceeding to the rest of the Required Tasks. And, as last week, type the changes in, do not copy/paste from anywhere.
… done …
Please note, this blog entry is from a previous course. You might want to check out the current one.
The first part of the second project is an reading assignment of the Swift Programming Language.
Continue reading “cs193p – Project #2 Reading Assignment”
Please note, this blog entry is from a previous course. You might want to check out the current one.
Lecture #5 starts with theory on how Swift was built to be compatible with Objective-C and thus provides numerous seamless bridging methods:
Additionally, it is possible to implicitly cast using as.
Continue reading “cs193p – Lecture #5 – Objective-C Compatibility, Property List, Views”
Please note, this blog entry is from a previous course. You might want to check out the current one.
When running on a real device, which region is set to something having not a “.” as comma symbol, the app crashes. Strangely it does not crash on the simulator.
One way to cope with this behavior is to force the number formatter to use the US locale all the time:
if let displayText = display.text { let numberFormatter = NSNumberFormatter() numberFormatter.locale = NSLocale(localeIdentifier: "en_US") if let displayNumber = numberFormatter.numberFromString(displayText) { return displayNumber.doubleValue } }
Continue reading “cs193p – Project #1 Assignment #1 Internationalization”
Please note, this blog entry is from a previous course. You might want to check out the current one.
Lecture #4 has no demo only theory:
Continue reading “cs193p – Lecture #4 – More Swift and Foundation Frameworks”
Please note, this blog entry is from a previous course. You might want to check out the current one.
Use Autolayout to make your calculator look good on all different kinds of iPhones in both Portrait and Landscape orientations (don’t worry about iPads for now). Just like we used ctrl-drag to the edges of our scene to position display, you can you ctrl-drag between your UILabels (and/or your C button) to fix their vertical/horizontal spacing relative to each other. Use the blue gridlines! It’s probably a good idea to reset all of your autolayout (via the button in lower right corner), then use ctrl-drag to add constraints to things that are not part of the grid of keypad and operation buttons, then use the buttons in the lower right to lay out those (after you’ve moved them in to place relative to your UILabel(s), etc., using dashed blue lines, of course!).
… which we did already for the previous task …