DPS923 MAP523 Week 2 Notes
Thursday, January 9 - classroom lecture
Monday, January 13 - hands-on in the computer-lab
The theme for this week is to learn and experience a number of user interaction capabilities and techniques. Along the way, you will work with more/new UI objects, and the lifecycle of an iOS app.
Thursday plan
Continue getting comfortable with the iOS developer environemnt and tools.
To start the session, we will probably briefly cover the leftover topic(s) from Monday, UI object table view (and any other leftover topic(s)).
Here’s a link to the interaction essentials notes.
Code examples
The course’s GitHub repo has code examples for many topics and techniques. You can download a zip of the code repo, or clone it.
- Text field, button, label
- More text field interaction; delegation
- Picker view, data source and delegate
- Table view
Monday plan
Then, we discuss a new topic in the first programming assignment - requesting data from a web API. The topic notes are linked here.
We will also get a gentle introduction to debugging.
Then, your professor will discuss the grading expectations for the programming assignment.
There will be time available to work on the programming assignment, but not enough to complete it.
Summary
Here’s a list of topics that we learned something about this week:
- Xcode code “re-indent” (select, then Ctrl+I)
- Role of the iOS “runtime” as the code that is in control of your device, and the app that is currently running on it
- The code we write does NOT control the logic flow and workflow, it merely reacts to it
- iOS apps are stateful, and remain in memory until forcibly removed (by the user or iOS)
- The role of a delegate in an iOS app (definition, meaning, interpretation)
- Examples of delegating objects include text field, picker view, table view
- The coding technique(s) to implement delegation
- Another UI object, text field
- Many string-like UI objects have a
.text
property, while number-like UI objects have a .value
property
- Text field and delegation, and some of its useful delegate methods
- Dismissing the on-screen keyboard when appropriate
- Another UI object, picker view
- The idea or concept of a “data model”, and our initial implementation of it as a simple array
- Building a picker view from a data source
- Handling picker view events with delegate methods, and NOT with action connections
- Another UI object, table view, and creating a new Cocoa Touch Class, as a subclass of UITableViewController
- Building a table view from a data source (i.e. a data model), and handling table view events with delegate methods
- The idea of a “prototype cell” to define the layout / format / content of each cell in a table view
- Gentle introduction to the role of a “navigation controller” and what it gives us (now - title area, and other features in the future including workflow and action buttons)
- The relationship between the prototype cell’s “Identifier” (in the attributes inspector) and the “identifier” value in the cell-building delegate method (i.e. the string values MUST match)
- Apple’s UIKit Catalog code example
- Gentle introduction to debugging
- Using documentation in the code editor (cursor to a symbol, then Option+click for help pop-up)