CSCI S-65: Mobile Application Development Using Swift and iOS

Summer 2018

Instructor
Daniel Brombergbromberg@fas.harvard.edu
Location
1 Story Street Room 304 (map)
Lectures
Tuesdays and Thursdays 3:30—6:30PM In-person, live Zoom teleconference and recorded for distance students
CRN (linked)
33310

ObjectiveTo lay a foundation in the concepts, libraries, and development tools necessary to create and deploy a realistic “App” (mobile software application) on latest-generation iPhones and iPads. We will focus on the fundamentals: the nearly mature Swift programming language, version 4.1; the Xcode IDE (Integrated Development Environment); the iOS development cycle, especially the Xcode interactive debugger; the essential Foundation and Cocoa Touch libraries; Apple best practices, especially the Model-View-Controller paradigm; responsive event handling, such as thread-aware task dispatching; the storage and recall of user data to remote and local databases; and deploying apps via iTunes Connect.

While the iOS API and Xcode toolset is vast, we intend to show enough core material and patterns such that students graduate able to apply their knowledge to uncharted territory and rapidly absorb advanced material on their own.

Pre-qualificationsStudents should take the self-assessment test if they have any uncertainty about prerequisites before enrolling. The emphasis is on general knowledge and experience that allows a sufficiently fast learning curve, not detailed knowledge of Swift and Xcode specifics. The test should take less than an hour. It is important before enrolling and investing considerable time & expense in the course that you feel confident in your answers. Please e-mail me individually if you are unsure about any particular answer or the overall difficulty level.

ReadingsReadings will come from a combination of: The Apple Developer Library; Chapters from new e-Books; and online tutorials. Students must understand that due to the young age of the technology, written documentation is relatively scarce and academic-grade texts do not yet exist. It is essential to be comfortable assembling know-how through a variety of sources, which will vary considerably in style, abstraction level, and intellectual depth.

The following introductory material is highly recommended as preparation for the first class and will be due for the 2nd class. Note all videos must be viewed in Safari on MacOS or iOS, the WWDC iOS App, or through iTunes Podcasts. Also note that Swift 4 language changes are much less significant and only matter if you already have substantial Swift 3 experience, so are not listed below. (For example, you can simply enjoy the fact that code now compiles faster, rather than knowing about the advancements.)

EquipmentStudents must bring their own portable Mac running OSX 10.13.4, with at least 8GB of RAM, an iOS device running iOS 11 with the latest updates, and Xcode 9.4 with the latest updates. For those interested in specializing their work for the iPad, owning one is highly recommended as well. In order to install apps on their own devices and distribute their compiled Apps to their peers and staff, students do not need be a member of any Apple program. Instead, any device physically connected to your development machine can accept installation of any App you write. The catch is that developer Apps will be valid for just two weeks from the point of installation. As soon as you re-install, however, the two week deadline is renewed.

Class materialsThe online hub for all course materials is hosted by the Harvard Canvas System. This includes lecture and section videos, a discussion forum, and ability to receive assignment grades. For all text and code-based materials where revision tracking is sensible, including distributed assignments and your own submitted work, we are using GitHub. Consistent with its Hub role, the Canvas site will have appropriate deep links into the course GitHub repository. See below.

Class assignments(which include readings) and lecture teaching materials (mostly example code, some diagrams) will be hosted on GitHub:

Students must create or use an existing free GitHub account, and will be granted access rights to the above.

Each student will be granted an individual private repository, into which they must submit all assigned work. The naming conventions will be spelled out so that all submissions have the same directory structure.

Online DiscussionWe will have a moderated discussion forum in the discussion area of the Canvas, with one thread per assignment. This is an essential tool to disseminate information efficiently in a fast-paced environment.

All questions about the course material should be directed to this forum for maximum visibility to staff and students. Students are strongly encouraged to use the forum on a daily basis to make their homework time efficient. Show leadership by asking questions. If you have a question that conerns the fundamentals, so does at least a third of the class. As far as the staff is concerned, a central premise of learning programming is doing some research, trying a few solutions, getting stuck, and asking an informed question – no matter how ‘basic’ you think it is. Participation credit is generously awarded for such efforts.

Other ContactE-mail, calls, and texts to the staff should only be used if you feel you need privacy, and in that order.

ToolsXCode 9.4 https://developer.apple.com/xcode/ide/

Online Read-Evaluate-Print-Loop (REPL) https://iswift.org/playground This is a pure Swift simulator – that is, no Cocoa or Cocoa Touch UI functionality – in a simulated terminal. It is good for entering experimental snippets to help learn the core language, such as closures and looping syntax. Make sure you select version 4.0 below right. Also note it is a bit slow.

WorkloadThis is an intensive course with ambitious goals of teaching a new programming language, an IDE, several frameworks, a variety of UI and design concepts, and practical debugging and deployment knowledge. Assignments will be issued once per week and due the next week. Students must commit to roughly 15 hours per week of homework, 3 hours per week of in-person class/section, and 30-60 minutes of pre-recorded lectures that cover pre-requisites for actual class.

AssignmentsTimely completion of reading and assignments is absolutely essential. There will not be much time for the staff to help students catch up on missed work or missed classes. Late work will not be accepted except for medical emergency or religious observance (for the latter, prior notification required). Because some answers may be revealed. in subsequent lectures, work that’s even a little bit late will not be accepted. Rather we will be very inclined towards partial credit as long as you turn in what you have on time, even if it doesn’t work or won’t compile. If you are having technical difficulties in submission, let us know immediately at the start of class.

In the event of any conflicting or ambiguous information on exactly what’s expected from each assignment, whether logistics or content, please let us know immediately. The Head TF is the final authority for all homework related matters.

Grading25% Class participation (includes section); 50% general assignments; 25% final project.

AttendanceBecause all lectures are now archived in this edition of the course with viewer tracking, all lectures must be attended in person or show as viewed to receive a grade.

Student Responsibilities, Academic IntegrityYou are bound by these school-wide policies:

http://www.summer.harvard.edu/resources-policies/student-responsibilities

There is no flexibility in these rules because they apply to the entire Harvard Summer School.

The remaining administrative guidelines are found in the parent web directory.

In addition, defining plagiarism in computer code has unique challenges, partly due to the fact that some simple techniques, especially those mandated by the given API or OS, are virtually identical across all programs, whereas deeper designs and algorithms vary as widely as original poems by different authors. When you learn how to do something from code on the Internet, no matter how well the learning process worked, and no matter how short the example:

you must cite the source - SINGLE LINE SOURCES INCLUDED.

The citation should appear as a comment (usually a valid URL, or complete book title and page) right above the relevant code. The only exception is if we've already given the source to the entire class.

The citation process is not merely busy-work; it helps us learn what students need help with, and to see if they're using authoritative, up-to-date learning tools. Further, we may want to share these tools with the class.

There is never a penalty for citing any (or many) sources; in fact it will reflect positively in your participation in the course. However:

For the first assignment, many answers are just one or two lines. Learning a language requires writing code from scratch – using the fundamentals. It doesn’t matter if there are dozens of existing solutions that are just a few search keywords away. Use official Apple documentation, Apple tutorials, and the help of the staff only.

Accomodations / disability services:In accordance with Summer School-wide policy

Lecture schedulePlease see Summer School calendar for critical administrative dates like course drop deadlines and refund deadlines.

Lectures will be heavily example-driven. Much of the material will be refined in layers over several classes. Schedule will also be adjusted to prevent average student workload from significantly exceeding aforementioned estimates.

Week Date Focus Specific Topics
1 2018-06-26 Introduction to Swift and Xcode for iOS Policies; Student Surveys; Xcode Intro: Demo of a basic iOS App & Playgrounds; a look at the Swift language
2 2018-06-28 App development and Swift essentials Navigating Xcode to create a real project: StoryBoards, Source files, & wiring them together (References & Outlets); Swift essentials: Arrays, Dictionaries, functions, Optionals, Control Flow
3 2018-07-03 Structuring a larger project Xcode and Swift Organizational concepts: Coordinating multiple source files; Swift classes & structs; Essential debugging; Basic interactive controls within UIKit
4 2018-07-05 The iOS API: Cocoa Touch UIKit building blocks: Views and View Controllers; important UIKit interactive and display widgets, attribute customization
5 2018-07-10 Layout and Drawing The Xcode Autolayout engine; working with constraints and the Scene hierarchy. Basic custom drawing (2D Quartz library); Touches and Gestures
6 2018-07-12 Model-View-Controller Clean separation of concerns; bringing together the essential pieces of any GUI App: Protocols, delegation, distinct model classes, observed properties, and notifications
7 2018-07-17 Pulling pieces into multi-screen app Application Lifecycle; Multiple views of same data, multi-screen apps: Tabbed Views, Hierarchical (Navigation Controller) Views
8 2018-07-19 Persistence; structured data display Timers; Property Lists (XML); JSON; NSCoder; Core Data; Table & List views
9 2018-07-24 Tables and data retrieval UITableView; JSON parsing and display
10 2018-07-26 Tables with images & navigation Advanced Tables w/Navigation controller Images; background (network-bound) data handling
11 2018-07-31 3rd party integration Tying App to FaceBook and Parse.com for user authentication, social sharing, and data storage
12 2018-07-02 MapKit & GPS Geotagging, Map annotations, using phone’s built-in GPS; Review of other topics as needed
13 2018-08-07 Additional Frameworks, Project feedback Physics (UIDynamics); Other topics, depending on student interest. Possibilities include: Review of previous advanced topics; Accelerometer; Affine Transforms; Font formatting
14 2018-08-09 Presentations 3-minute live & video presentation marathon.