iOS App Development with Swift
Table of Contents
IntroductionMaximiliano Firtman introduces the course by providing some personal background with mobile development and discussing an overview of what material will be covered in this course. Pre-requisites, a frontend map demonstration, and a brief discussion of the UI frameworks available to use with Swift are also provided in this segment.
Course Project FilesMaximiliano walks through the provided course project files and demonstrates a finished version of the course project.
Swift OverviewMaximiliano provides an overview of Swift, including who developed it, its type of language, available platforms, and the included null-safety. A discussion regarding language types, what type of application will be created, and the contents of the resulting project ZIP file are also covered in this segment.
Basic ExpressionsMaximiliano demonstrates writing basic Swift expressions in an Xcode playground, including booleans, C-syntax, variables, data types, and valid identifiers. Everything declared in Swift is accessible to every other file in the project.
VariablesMaximiliano discusses defining variables in Swift, including constants, types, explicitly defining data types, and core data types. Swift will infer and enforce variable types but can be overridden with the Any keyword.
Null SafetyMaximiliano discusses the concept of Null Safety, Null-safe operators, and how to treat properties as optional using a question mark or non optional using an exclamation mark. The functions of other operators, including the safe operator, default values, and explicit optional unwrap, are also covered in this segment.
FunctionsMaximiliano demonstrates writing functions in Swift, setting function return types and the option to omit the return keyword. How to utilize Xcode to help troubleshoot argument errors and how to handle optional arguments when defining a function are also covered in this segment.
ClosureMaximiliano discusses Swift closures as literal functions, anonymous functions, or lambda expressions in other languages. The data type Void being used to express no return value and the syntax for functions receiving closures as arguments are also covered in this segment.
Structs, Protocols & ErrorsMaximiliano answers student questions regarding having structures instead of tuples and if classes are more efficient than structs. A walkthrough of error management using do, try, and catch is also provided in this segment.
Swift UI OverviewMaximiliano discusses an overview of the multi-platform declarative UI framework Swift UI. Swift UI can use single or double-way data binding to re render dependencies.
Creating the ProjectMaximiliano walks through creating a new project in Xcode using the iOS App template and selecting SwiftUI as the interface type. A demonstration of some features of the Xcode user interface is also covered in this segment.
Build & Run App in SimulatorMaximiliano demonstrates editing the metadata of the course application and how to run the application through an iOS simulator. The iOS simulator will run using the computer's processing power, not an iPhone, and therefore may not accurately show application performance.
Creating Reusable ViewsMaximiliano discusses the function of the some keyword regarding multiple Scenes and demonstrates having multiple content views using the Xcode previewer. The View of the body must return only one view, which will result in two simulators unless adequately grouped.
Modifiers & InspectorMaximiliano demonstrates how to use modifiers to create a new version of a text object with the modifier applied; the inspector can also be used to edit modifiers. Modifiers are applied in a chain, meaning each subsequent modifier is layered on top of the result of the previous function.
Binding Data to ViewsMaximiliano walks through how to bind data to views to pull in variables and change dynamically on user input. Binding data to a view allows each view instance to be reusable.
SwiftUI Concepts & View Types
Concepts & View TypesMaximiliano briefly discusses an overview of SwiftUI's main concepts, including app, scene, view, view modifier, dependencies, dimension unit, and graphical assets. View types covered include text, label, button, the various types of stacks, and spacer.
OfferMaximiliano walks through creating the first view of the course project to represent an available discount offer and demonstrates how to create multiple previews by copying the same view. A student's question regarding how the structs defined in offer get imported to ContentView is also covered in this segment.
ColorsMaximiliano demonstrates how to create and utilize a referenceable color library in Xcode. The created color library will allow colors to be dragged and dropped into the code as modifiers.
ImagesMaximiliano walks through how to create a new reusable image asset. It's better to have three different-sized png images to render the correct quality at different screen sizes.
Navigation TabsMaximiliano demonstrates creating an interactive bottom navigation bar and finding the appropriate icons using SF Symbols. The tabs created in this segment will switch between application pages.
Creating Page ViewsMaximiliano demonstrates how to group files in Xcode and create the three remaining application pages. A student's question regarding the difference between assets and preview assets is also covered in this segment.
Creating Data ModelMaximiliano walks through creating and connecting the category and product data models to allow importing dependencies. MenuManager and CartManager classes are also created to help download and store the application content.
Environment ObjectsMaximiliano demonstrates using View structure objects called environment objects to avoid passing data manually as properties. Environment objects can be injected at any level.
Shopping Cart & Refactoring ViewsMaximiliano demonstrates adding content to the shopping cart page and an Xcode error message.
Adding Alamofire PackageMaximiliano walks through adding and importing a dependency called Alamofire which is used to download JSON from an API.
Using the API DataMaximiliano demonstrates how to pull in the data being stored in the managers to populate the menu items. Editing the product prices to the correct decimal points is also covered in this segment.
Cart & BadgesMaximiliano implements add and remove functions to allow items to be added to and removed from the cart. Updating the cart total and badge showing the number of items are also covered in this segment.
Cocoa PodsMaximiliano demonstrates utilizing an environment variable to inject variables from the OS. Student questions regarding why Alamofire was used and not CocoaPods and the benefits of using Alamofire are also covered in this segment.
Launch ScreenMaximiliano walks through adding an application icon and rendering a launch screen to display a splash screen when the application launches.
Final BuildMaximiliano demonstrates how to make the final build through Xcode and distribute the app to the App Store. A student's question regarding how to run the application on a personal device is also covered in this segment.