All new CS193P started at Stanford sometime back. Great news is, that it’s being taught in Swift. I have just finished listening first 2 lectures. I am quite impressed with Paul Hegarty. He starts the lecture with firing Xcode, talking about it and then beginning to code a Calculator app in Swift. He explains concepts as and when needed while using them. Quite hands-on and practical approach I must say.
If you have some experience with programming and are well conversant with OOPS concepts, then the course should be really easy to follow for you. It’s a free course and available via iTunes, so I think anybody who is beginning with iOS development or Swift should really go through it.
Paul explains basics of autolayout in Lecture 1 and explains constraints in Lecture 2. However what stands out in Lecture 2 (last 20 mins) is his explanation of MVC, he does that like a rock-star and uses roads, arrows, radio transmission analogies to drive home his message.
There are reading assignments and programming assignments associated with lectures. I religiously read all the prescribed sections from the official Apple book and actually did learn a few new things which I missed when I went through the book earlier. A couple of them are:
Swift’s remainder operator can also operate on floating-point numbers: 8 % 2.5 // equals 0.5
We should Use ++i and –i in all cases instead of i++/i–, for expected behavior of modifying i and returning the result.
Then I moved onto Programming Assignment and started coding the calculator. However I was not really comfortable with the RFP Calculator, Paul demoed in the class, so I decided to instead code simple, standard calculator. Here is my code for it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
It’s pretty simple code and I hope should be clear enough. Full project code is available at Github
Happy Learning :-)