Sample iOS and watchOS application
To begin working on this step:
git checkout master
- Understand Basic Swift Syntax
- Understand Basic Xcode IDE and Project Structure
- Understand the structure of view controllers and how to display them
- UIAppDelegate
- Description
- Handles the various states and outside entry points into the application
- Properties and Methods
- application(_:willFinishLaunchingWithOptions:)
Setup the
UIWindow
for themain
UIScreen
with the rootUIViewController
- application(_:willFinishLaunchingWithOptions:)
Setup the
- Description
- UIWindow
- Description
- Backdrop of the UI
- Properties and Methods
- init(frame:)
Setup a new
UIWindow
based on theUIScreen
- rootViewController
The root
UIViewController
- makeKeyAndVisible()
Make the
UIWindow
key and visible
- init(frame:)
Setup a new
- Description
- UIScreen
- Description
- Properties associated with a hardware-display
- Properties and Methods
- main the main screen of the device
- Description
- UIViewController
- Description
- Base View Controller
- Description
- UITabBarController
- Description
UIViewController
which contains a series of bottom tabs
- Properties and Methods
- setViewControllers(, animated: Bool)
Set the
UIViewController
for each tab
- setViewControllers(, animated: Bool)
Set the
- Description
- UINavigationController
- Description
UIViewController
for allowing tree-like navigation
- Properties and Methods
- init(rootViewController:)
Creates and new
UINavigationController
with a the designatedrootViewController
- init(rootViewController:)
Creates and new
- Description
- UITableViewController
- UIAppDelegate
-
Create a class for listing users by subclassing UITableViewController
- Hints
- create a new Cocoa Touch Class subclass of
UITableViewController
calledUsersTableViewController
- create a new Cocoa Touch Class subclass of
- Hints
-
Display a single tab for listing users (no items needed yet)
- Hints * in
application(_:willFinishLaunchingWithOptions:)
... create aUIWindow
with the size of themain
UIScreen
- ... create a
UINavigationController
with arootViewController
ofUsersTableViewController
- ... create a
UITabBarController
with our newUINavigationController
- ... set the
rootViewController
of the newUIWindow
to our newUITabBarController
- ... make the new
UIWindow
key and visible - ... set the
window
property to the newly createdUIWindow
- ... return
true
- ... create a
- Hints * in
Optional
- Use extensions to refactor the way our view controllers are displayed
To skip ahead and begin working on this step:
git checkout feature/step-1
- Reading a file from the Application Bundle using the Data type
- Bundle
- Description
- set of code or resources such as an application or framework
- Properties and Methods
- main
- the main application bundle
- url(forResource:withExtension:)
- attempts to return the url based the resource name and extension
- main
- Description
- Data
- Description
- a set of binary data
- Properties and Methods
- init(contentsOf:options:) throws
- attempts to pull the binary data from a url, throws an error if failed
- init(contentsOf:options:) throws
- Description
- Bundle
- Codable protocol for easy JSON decoding
- JSONDecoder
- Description
- object which decodes a data type from JSON
- Properties and Methods
- decode(_:from:)
- decodes the binary data from JSON format to a
Codable
value of the type specified
- decodes the binary data from JSON format to a
- decode(_:from:)
- Description
- JSONDecoder
- Delegation pattern and how it is used with UITableViewController
- UITableViewController
- Description
- a
UIViewController
which encapsulates aUITableView
,UITableViewDataSource
,UITableViewDelegate
- a
- Properties and Methods
- tableView
- the
UITableView
managed by theUITableViewController
- the
- tableView
- Description
- UITableView
- Description
- a
UIView
for representing rows of data
- a
- Properties and Methods
- register(_ nib: UINib?,
forCellReuseIdentifier identifier: String)
- registers a
UINib
of the cell to be used throughout theUITableView
- registers a
- reloadData()
- basic method for reloading
UITableView
rows - Note there are preffered methods of doing this such as reloadRows or performBatchUpdates
- basic method for reloading
- dataSource
- property which defines the
UITableViewDataSource
of theUITableView
- property which defines the
- register(_ nib: UINib?,
forCellReuseIdentifier identifier: String)
- Description
- UITableViewDataSource
- Description
- a protocol which returns the data and cells for a
UITableView
- a protocol which returns the data and cells for a
- Properties and Methods
- numberOfSections(in:)
- defines the number of sections in the
UITableView
- defines the number of sections in the
- tableView(_:numberOfRowsInSection:)
- defines the number of rows in a particular section for the
UITableView
- defines the number of rows in a particular section for the
- tableView(_:cellForRowAt:)
- returns the
UITableViewCell
for the particular row and section of theUITableView
- returns the
- numberOfSections(in:)
- Description
- UITableViewController
- Basics of Model-View-Controller pattern
- Concept of Optionals and Optional Chaining and how to work with them
- How to throw and catch Errors in Swift
- Use JSONDecoder to parse the bundled JSON using Codable into a set of structs
- Hints
- Get the url of the JSON file resource from the
main
Bundle
- Get the binary
Data
object from the url - Make
User
implement both theUserProtocol
as well as theCodable
protocol - Use the
JSONDecoder
todecode
the binary data into a container object with aUser
Array
- Get the url of the JSON file resource from the
- Hints
- Create and register a custom UITableViewCell and understand how to use IBOutlet
- Hints
- Create a custom
UITableViewCell
Cocoa Touch class - Use Xcode to define a series of
@IBOutlet
properties which connent with UI element in thexib
- Create a custom
- Hints
- Display the list of users from the JSON file into the
UsersTableViewController
- Hints
- register our custom
UITableViewCell
Cocoa Touch class - call the method to retrieve users from the database and reload the
tableView
- implement both
tableView(_:numberOfRowsInSection:)
andtableView(_:cellForRowAt:)
- in
tableView(_:cellForRowAt:)
dequeue our customtableView
cell - set each property in our custom
UITableViewCell
- register our custom
- Hints
- Understand the basics of updating the user interface and the
main
thread- Hints
- All UI changes need to be on the
main
thread
- All UI changes need to be on the
- Hints
To skip ahead and begin working on this step:
git checkout feature/step-2
- Being able to decode dates from JSON - JSONDecoder.dateDecodingStrategy
- Allow for greater flexability using Protocol-Oriented Programming
- Create more complex return types using Functional Programming (map, reduce, sorting, max, etc...)
- Application Transport Security
<key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>lorempixel.com</key> <dict> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSIncludesSubdomains</key> <true/> </dict> </dict> </dict>
- Setup Posts and Comments
- Dealing with Dates and Codable
- Basic Functional Programming
- Setup Application Transport Security
git checkout feature/step-3
- Using a Storyboards to customize the UI of the main WKInterfaceController
- Setup a menu for displaying users and posts
- Dynamically display a different sets of data into a WKInterfaceTable
- Push and pass context to a new WKInterfaceController