Prof. Brian R. Hill, Ph. D. (follow this link for contact and office hours)
We are finishing out this course using Xcode 7.3, Swift 2.2, Mac OS X 10.11.4 and iOS 9.3.1. In this course, the goal is to stay cutting edge, but because you are learning something new, it is a good idea to avoid the bleeding edge (specifically, please avoid the betas of Xcode 7.3.1, Mac OS X 10.11.5 and iOS 9.3.2).
Because the principal documentation is on-line resources provided for free by Apple, there is no required textbook. The first and foremost of these documents is The Swift Programming Language (Swift 2.2).
Also, I looked at a lot of books on Swift before deciding that there was no single book it made sense to require. If you want to purchase some of these books see the Annotated Bibliography. The one I would most call your attention to if you are finding the course easy is "Advanced Swift" by Eidhof and Velocity. Conversely, if you are having a rough time in the course, consider "Learn to Code in Swift" by McNeish.
Finally, the README in each Problem Set (for example, Problem Set #1) has additional references relevant for that week's lectures and problems.
Actually, I will elaborate by giving an example of the last point. Consider Getaround, whose original business model could be summarized as "AirBnB for cars." They evolved their mobile rental business model and remote unlock solution using iOS and the web. Only in November, 2014 after five years of evolving and expanding did they announce their Android app. Imagine a company that is learning and pivoting as fast as it can also having to keep two mobile teams staffed and synchronized. Since I worked there, I can assure you that is an added burden they could do without.
If none of that was compelling, just face the fact that the cellular network and mobile computing are now ubiquitous, and understanding how it works and what it can do is not possible to explore that without at least partially embedding yourself in one or another proprietary systems.
I intend—through lectures and problem sets—to lead you to the point where you can build simple applications in Swift confidently. This will likely take us the first six weeks of the term. With that foundation, you will choose and implement a project. While you are doing that we will continue to learn more advanced features of Swift and iOS.
A practicing software engineer needs skills in three major areas: (1) the technology du jour, which for purposes of this course is iOS and Swift, (2) good engineering practices, which are considerably more timeless, (3) computer science knowledge, which transcends any specific technology, and can approach the rigor of mathematics, but which is sufficiently abstract and academic that it isn't actually very much in play on any given project.
The bulk of the engineers in Silicon Valley are only expert in the first area even if they have degrees in computer science. This gives them a short shelf life, unless they have the energy to keep up with the latest fads. If you desire to be really good for more than a few years, you should develop all three areas. Our class will have about 60/20/20 emphasis on the three areas. Almost all intros to iOS programming are more like 85/10/5. That's why we aren't using someone else's cookbook intro. See the Bibliography for a recommendation if that style attracts you.
A successful software engineer also needs good marketing sense, good business and financial sense, affability and good teamwork. You'll get a taste of how important all the skills are when you are doing your project.
All Problem Sets will be distributed and returned using GitHub. GitHub is cloud-hosted git. Git solves the problem of distributed version control, a problem so complex it was not obvious it has a reasonable solution until git became proven. The same person that is behind Linux is behind git. Linus Torvalds has achieved the same level of influence as Richard Stallman with this and I wouldn't be surprised if in the very long-term Torvalds is more rememembered for git than Linux.
My GitHub account is github.com/brianhill. GitHub accounts are free. Go to that link. Make sure you can find Problem Set #1 and then start following the directions in the README.
There will be a project in the latter half of the term. I have never taught or been part of a course that had a project as a significant part of its grade. We're doing it anyway, because it is very important to experience the software development lifecycle, and for those of you that are thinking of getting a job in Silicon Valley, to start proving that you can bring ideas to fruition by developing a portfolio.
The Midterm and Final will use the same format as the problem sets. Thanks to the fact that IT has upgraded the machines in Garaventa to have Xcode 7.2.1 we will be able to conduct the Midterm in Xcode rather than writing it out.
What I want to test on exams is that you understand Swift's language features, including both basic and intermediate-level ones.
The grading breakdown will be 40/20/20/20, where the percentages are Homework/Midterm/Project/Final. There will be approximately 80 points distributed over approximately 10 homeworks.
We will have topics in all of the three areas discussed in the Overview above. These topics will be interwoven. See the Detailed Schedule below (subject to amendment as the term progresses).
Lectures | Topics |
---|---|
Feb 9 | Git, Github, Distributed Version Control, Xcode Storyboards. |
Feb 11 | Basic Swift Syntax, Local Variables, Statements. Views, View Hierarchy, View Drawing. Drawing in a Custom UIView. |
Feb 16 | Events, UIButton, the Touch Up Inside vs. Touch Down Event, Making Target-Action Connections in Xcode, View Tags |
Feb 18 | Model-View-Controller Pattern. Merging and Re-Ordering Commits (Rebasing), Shell Variables (particularly $EDITOR), A Few Emacs Commands, Test-Driven Development, XCTestCase, Executing Tests in Xcode. |
Feb 23 | How Computers Store Numbers: Bytes, Nibbles, Octal, Binary, Hex, Binary Coded Decimal, 10's Complement Representation of Negative Numbers. HP-35 Registers, Signs, Mantissas and Exponents. How the HP-35 "Canonicalizes" User Input. |
Feb 25 | View Transitions (Segues) in Storyboards, UIImage and UIImageView, Asset Management, the App Wrapper, UI Guidelines. |
Mar 1 | Roles on a small app development team (including Product Manager, QA/Customer Service, Engineer), Agile Project Managment with Pivotal (or Trello), what makes a good Task/Story in Pivotal, Section 4.1 of "Advanced Swift" (By-Copy and By-Reference Semantics, especially for arrays), NSArray, NSMutableArray, upcasting, downcasting, Section 4.2 of "Advanced Swift", Functions as First-Class Objects, Closures, anyPower example. |
Mar 3 | Finish Section 4.2 of "Advanced Swift", especially, map, filter and reduce. Introduce UITableView by starting an app to display upcoming softball games. |
Mar 8 | Inheritance of methods and how they are overridden. The difference between run-time binding and compile-time binding. Protocols and how they are in practice less likely to make a mess than multiple inheritance. An exposure to how delegation and protocols are used by Apple in UITableViewDataSource and UITableViewDelegate. UITableView is important, but it is also so complex that we'll also do a UITextViewDelegate example next class. |
Mar 10 | A UITextViewDelegate example in which the delegate tells the text view to resign first responder when a newline is entered. Explain the keywords self and super and how to use them to access and "chain" superclass methods. Explain the difference between instance methods and class methods. Introduce instance variables and show how they are inherited. The difference between instance variables and class variables. Introduce the static keyword. |
Mar 15 | Review escaping in character sets and explain why one of the Rot13 test cases failed (the one with Cantonese). Discuss branches in GitHub. Discuss how branching is used for teams working in parallel (e.g., ios-9_3 branch in parallel with ios10 branch). Review differences between rebasing and merging. Discuss and practice resolving conflicts when rebasing or merging (Cerypto rename). Brainstorming session for app ideas (see email with everyone's ideas collected). |
Mar 17 | Midterm. |
Mar 29 | RSA data encryption, Part I. Prime Number Utilities. Product Management. Agile Project Management. User Stories. |
Mar 31 | Using Pivotal Tracker. Project Kickoff Meeting. |
Apr 5 | RSA data enctryption, Part II. Public Key Generation. Encrypting with Public Key. Dictionaries and Sets. Performance considerations. Cache invalidation. |
Apr 7 | Brief Project Status Presentations followed by Project Planning. |
Apr 12 | Instance variables. Fancier instance variable techniques: getters, setters and computed values. Property observers. UITableView, UITableViewDataSource and UITableViewDelegate. Segues in storyboards. Using segues to pass data between view controllers. |
Apr 14 | Brief Project Status Presentations followed by Project Planning. |
Apr 19 | We illustrated the topics from April 12th by following three "envatotuts" tutorials starting with the "Swift from Scratch: Inheritance and Protocols" tutorial. When we picked up on April 19th, we also learned how to use git to check out at a specific revision (and discussed detached HEAD mode in git). The finished code from all three tutorials is in the tutsplus-todo-app repo in GitHub. |
Apr 21 | Brief Project Status Presentations followed by Project Planning. |
Apr 26 | Two modulo arithmetic identities underlying RSA. Generics, SequenceType, CollectionType, GeneratorType (all of which are protocols relating to the collection classes). Protocols do not support generics—only classes, structs and enumerations. Protocols do support associated types. A playground illustrating this material. |
Apr 28 | Brief Project Status Presentations followed by Project Planning. |
May 3 | Generics in enumerations. Optionals are enumerations. Exception Generation. Exception Handling. |
May 5 | Brief Project Status Presentations followed by Project Planning. |
May 10 | Automatic Reference Counting (ARC). Zombies. Performance tools for analyzing slow or bloated applications: (1) The profiling tool, and (2) The leaks tool. Strategies for speeding up slow apps (caching, off-loading work from the main thread). Example: we worked through the Ray Wenderlich Xcode Instruments tutorial. | The example has a very instructive situation where a leak of a view controller is caused by a closure. The retain cycle is: a table view retains its table view cells, each table view cell has a closure, and the closure retains a reference to the table view.
May 12 | Team Project Demos. See Team Projects. |
May 19 | Final, 8am-10am. |