Transitioning to Swift
For current iOS developers transitioning from Objective-C to Swift. Helps you gain hands-on proficiency with Swift in the context of typical Cocoa touch project development tasks.
Description
This course is for iOS developers transitioning from Objective-C to Swift. It differs from our Swift Programming course in that it quickly moves from language fundamentals to hands-on iOS app development in Swift. That will allow you to quickly get comfortable using Swift to tackle typical Cocoa touch development tasks. You’ll also gain practical experience with subtle changes in approach needed that will allow you to take better advantage of Swift’s powerful language features.
By the end of the class, you’ll have gained hands-on proficiency with typical iOS development tasks in Swift, plus a solid understanding of the differences between the Swift and Objective-C programming models.
- Learn the fundamentals of Swift programming and the standard Swift library.
- Gain hands-on experience working with the REPL and Xcode Playgrounds.
- Get familiar with the Swift type system, including generic types.
- Learn to create, extend and use Swift structs, classes, protocols, and enums.
- Work with properties, methods, and subscripts at the instance and type level.
- Use extensions to enhance the capabilities of existing types.
- Get clarity on the most effective use of optionals, nil-coalescing operators, and optional chaining.
- Learn functional programming techniques, including map/reduce.
- Understand the differences between the Swift and Objective-C programming models.
- Get comfortable using Swift with Cocoa touch classes and APIs.
- Know how to bridge Swift and Objective-C code.
Course Outline
Swift Fundamentals - Master the fundamentals: constants, variables, data types, expressions, operators, statements, looping and branching, and more.
Functions, Tuples, and Closures- Learn to declare and implement Swift functions, work with named parameters, and use tuples as arguments and return values. Understand what closures are, and how they capture state. Learn to work with functions and closures as arguments to — and return values from — other functions.
Characters and Strings - Learn to work with Unicode characters and strings, and become familiar with Swift's powerful string interpolation feature, as well as string functions and operators.
Collections - Get familiar with the arrays dictionary, and set collection types provided by the Swift standard library, and get a solid handle on the differences between working with mutable and immutable types. Understand where it makes sense to use Swift types versus `NSObject` subclasses.
Working with Generic Types - Understand the purpose, syntax, and usage of Swift's generic types.
Switch Statements - Learn to use the powerful pattern-matching capabilities of Swift's switch construct to dramatically simplify program logic.
Functional Programming Techniques - Learn how the functional programming model, as exemplified by map/reduce, currying, and partial application, can simplify numerous coding tasks. Discover where and how these techniques fit in typical Cocoa touch programming
Classes and Structs - Learn the basics of declaring Swift classes and structs; writing method, property, and initializer implementations; and allocating and initializing instances.
Methods, Properties, and Subscripts - Learn how to define methods at the type and instance level, and work with local and external parameter names. Also learn how to define stored, computed, andlazy properties, as well as custom subscripts, and how to use property observers to respond to changes in property values.
Enums and Optionals - Learn the basics of enums including methods, initializers, raw values, and case matching.
Optionals and Casts - Understand how optionals work under the hood, and get your code working smoothly with this essential feature of Swift. Learn how to unwrap optional values safely through the correct use of operators such as ?, !, as, as?, and ??. And learn to use optional chaining to streamline your code.
Protocols - Learn to declare protocols with required and optional methods, and get familiar with common framework and standard library protocols.
Extensions - Learn to enhance existing classes, protocols, structs, and enums by adding custom properties and methods, and discover great techniques for streamlining your codebase.
Protocol Extensions - Learn to harness this powerful new Swift langugage feature in ways that can radically streamline the design of classes and structs.
Bridging to Objective-C - Understand how to correctly bridge between Swift code and Objective-C classes and methods, as well as C library functions and low-level types.
Cocoa touch Design Patterns - Gain hands-on experience using Swift to implement common Cocoa touch design patterns.
Access Control - Understand how to control the visibility of properties, methods, initializers, and subscripts, as well as types, such as classes, structures, and enumerations.
Managing Memory - Review how memory allocation and deallocation are managed by ARC (automatic reference counting). We'll also review how to optimize your app's memory footprint with autorelease pools.
Testing - Get up to speed on unit testing and automated functional testing with the XCTest framework and Xcode's built-in tooling.
Audience
Current iOS developers who are transitioning from Objective-C to Swift
Prerequisites
A minimum of six months of hands-on experience developing iOS apps in Objective-C