
Begin your Swift journey with basics, object oriented programming, collections, generics, and closures, and build a two-screen iOS app using storyboards and a master-detail table view.
Explore Swift, Apple's modern language designed for code safety and memory management, with closures, generics, and namespaces, contrasting with Objective-C and how to get started with the Swift beta.
Swift removes semicolons and header files, enables type inference and first-class functions with generics, and offers cleaner string manipulation, switch behavior without break, and easier value observation for iOS development.
Access your working files by downloading the zip and extracting it to your desktop. Then use the player's open working files button to locate and copy the files for lessons.
Explore how the Xcode playgrounds tool lets you test Swift code and visualize a label, with quick look and value history to see results in real time.
define constants in swift with the let keyword, use expressions, and print values. understand swift's type inference, unicode names, and the rule that identifiers cannot start with a digit.
Use the var keyword to define variables in Swift, such as an integer named X, which you can reassign and print with string interpolation using backslash parentheses.
Explore how Swift enforces type safety by inferring types from initial values, using explicit type annotations and optional types to handle nil, and applying type aliases for clarity.
Learn to define and call functions in Swift, from a hello world example that prints a string to a function that returns an integer using the return arrow syntax.
Explore how Swift handles function parameters, including variadic parameters and external parameter names, with examples like add and divide to improve readability and understanding.
Explore how Swift handles parameters: by default constants, use var to create a local mutable copy, and inout to modify the outer value via pass by reference with ampersand.
Explore how to return multiple values with tuples in Swift, define and access tuple elements, and use optional tuples with nil to handle failed calls.
Learn how to use the Swift if statement to test conditions, compare values like x < 2, and include else blocks to control flow.
Explore swift's switch statement, including cases, ranges, and default; learn how fall through works, and how to match values, tuples, and strings concisely across data types.
Discover how to use the Swift for loop with an initializer, condition, and increment, noting no parentheses and a three-iteration pattern that mirrors C-style loops.
Explore for-in loops in Swift to iterate over arrays and dictionaries, print items, and apply range-based iteration with syntactic sugar for concise loops.
Learn Swift while loops with a condition, optional parentheses, and a simple increment to loop up to ten times, plus the do while variant that guarantees at least one execution.
Learn how to control flow in Swift with break and continue in loops and switches, use labeled breaks and continues for outer loops, and manage nested blocks effectively.
Explore automatic reference counting (ARC) and how it manages memory with strong references, retain and release, eliminating garbage collection on iOS and macOS.
explains strong and weak references in arc, shows how circular strong references create memory leaks, and demonstrates breaking the cycle with a weak reference in an order and product scenario.
Explore closures in Swift by building a do math function that accepts two integers and an inline closure, then learn long-form and shorthand syntax, parameter inference, and $0/$1 usage.
Capture values from the outer scope with closures and retain them within the closure, enabling a function to return a string by capturing a name variable.
Learn trailing closures in swift by moving long closures after the final function parameter to improve readability. Use trailing closures when the closure is the only or final parameter.
Explore Swift arrays, including strong typing, type inference, mutability with let and var, and common operations like append, insert, remove, for-in looping, and subscript access and update.
Learn how to define and modify dictionaries in Swift by using key-value pairs, access via subscripts, check count and isEmpty, update or remove values, and iterate unordered entries.
Define a custom class in Swift with the class keyword and instantiate it using ClassName(). Understand that classes are reference types, so assignments share references rather than making copies.
Master swift class initializers, including default, designated, and convenience forms, using self to assign x and y and delegate to other initializers. arc handles memory and deinit cleans up.
Explore Swift class methods, including adding to a total in a calculator class, and calling methods with external parameter names for multi-parameter functions like divide.
Learn how Swift uses stored properties with var or let, create computed properties like volume with getters, and defer initialization with lazy properties in a Rectangle class.
Explore inheritance in Swift by building a base vehicle class and a sedan subclass. Learn how to override methods, call super, and apply final to prevent overriding.
Explore type casting between vehicle subclasses using is and as? to downcast to sedan or truck. Iterate an array of vehicles, access class-specific properties safely, and avoid runtime crashes.
Swift provides any object and any for handling unknown values; use as and as? to cast arrays of any objects, as shown with cars.
Learn how protocols act as contracts that require classes to implement specified properties and methods, with examples from delegate patterns and a game controller protocol defining a speed property.
Implement a Swift game controller protocol by making a car conform, using the protocol as a type in the game engine, and calling accelerate, turn left, and brake.
Extend existing classes in Swift using the extension keyword to add new functions, such as a string reverse, by looping through self and returning the reversed result.
Discover how Swift treats enumerations as full-fledged types, not automatically backed by integers, with computed properties, examples like elements, and exhaustive switches.
Explore how swift enums can carry associated values, such as element costs for spells, and learn to attach, access, and extract those values with switch statements.
Discover how Swift enumerations can have raw values backed by integers or strings, access them with the dot to raw function, and handle nil for invalid inputs.
Explore how Swift structures work as value types with properties, memberwise initializers, and methods, and compare them to classes for copying and utility.
Explore generic functions and generic types in Swift by defining a generic log function with a type parameter, applying the printable interface constraints, and producing meaningful object descriptions.
Explore generic types by building a name value pair class with two type parameters, T and U, showing how generics compile to specific types and reduce boilerplate in Swift.
Learn how Swift's optional chaining traverses object graphs, accessing properties through a car, its driver, and a car lot with a subscript, avoiding nil errors and reducing code clutter.
Explore bitwise operators in Swift, including not and or, and the tilde for bit inversion, plus left and right shifts, binary notation (0b), and two's complement for negative numbers.
Discover bitwise and, or, and xor in Swift by comparing two unsigned integers, showing how matching bits stay, how or preserves ones, and how xor produces exclusive ones.
Overload Swift operators to customize behavior for your structs, such as adding points with a plus operator, plus equals assignment, and an equality check to compare points.
Build a master detail iOS app in swift by creating a task class, converting to a swift array, and wiring the master and detail views with a prepare for segue.
Build a Swift master-detail task app by connecting storyboard outlets and actions to a detail view, edit the task title in a text field, save, and return to master list.
Review the basics and advanced features of Swift, including variables, functions, arrays, dictionaries, classes, protocols, generics, and custom operators, reinforced by a sample iOS task management app.
This Learning to Program with Swift training course from Infinite Skills will teach you how to program with Swift for iOS and Mac OS. This course is designed for beginner and experienced developers, and knowledge of Java, C#, or other modern languages is recommended.
You will start with an introduction to Swift, including learning how to define constants and variables and learning about conditional statements and control flow statements. From there, Rogers will teach you about the Swift language features. This video tutorial will also cover Swift classes and inheritance, as well as enumerations, structures, generics, and operators. Finally, you will see Swift in action as you watch Rogers demonstrate a Master-Detail application.
Once you have completed this computer based training course, you will be fully capable of using Swift’s modern features to program for iOS and Mac OS. Working files are included, allowing you to follow along with the author throughout the lessons.