O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering Swift 2 Programming

Video Description

An in-depth video course that covers advanced Swift programming and focuses on writing highly performant, elegant, and readable code

About This Video

  • Explore Swift's revolutionary leap from Objective-C, and leverage its higher-level features to get the most out of the Cocoa framework

  • Learn how to exploit compiler optimizations to attain blazing code performance

  • Gain a deeper understanding of your Swift code through dynamic and easy-to-follow demonstrations

  • In Detail

    Swift 2 is a multi-paradigm programming language that has expressive features familiar to modern functional languages, and does not forget the object-oriented features of Objective-C. Things that took a block of code in Objective-C are reduced to one or two lines in Swift. Swift is said to be safer, faster, and easier to understand, and has the energy of Apple and the open source community behind it.

    This course takes you on a journey through a wide array of topics that are crucial to writing top-level Swift code. You will get an in-depth view of various core topics such as advanced language features, memory management, interoperability, concurrency, advanced debugging, algorithms, and performance optimizations. Last but not least, we’ll also explore Swift design patterns.

    We’ll start by discussing the uniqueness of Swift, what’s new, and what’s to come. Then we take a look at fast-paced deconstructions of advanced language features such as extensions, generics, protocols, and more. Next we’ll focus on memory management as you learn how to measure and address our applications’ memory usage.

    Soon we’ll dive into opening Swift up to Objective-C, C, and even C++ code and speeding up development by leveraging third-party frameworks. We will then move on to asynchronous programming and concurrency and you’ll see how to process multiple tasks simultaneously.

    You’ll discover how to debug your applications more effectively, which is one of the key components to becoming a faster developer. As the journey comes to an end, we will take a look at compiler optimizations, performance measurements, and algorithms and complexity. Finally, you’ll explore specific design patterns can address common programming problems.

    Table of Contents

    1. Chapter 1 : Swift Primer and Introduction to Functional Programming
      1. The Course Overview 00:04:03
      2. Swift Review – Operators, Types, and Strings 00:06:14
      3. Swift Review – Collection Types 00:05:23
      4. Swift Review – Classes, Structs and Enums 00:05:51
      5. Swift Review – Flow of Control and Optionals 00:06:06
      6. What’s New in Swift 2? 00:05:40
      7. Functional Programming 00:05:11
      8. Protocol Oriented Programming 00:03:49
    2. Chapter 2 : Advanced Language Features and Functional Concepts
      1. Introducing Game of Life 00:09:17
      2. Function Value Types and Closure Syntax 00:03:57
      3. Extensions 00:05:47
      4. Generics 00:05:29
      5. Higher-order Functions – Filter 00:08:16
      6. Higher-order Functions – Map 00:05:10
      7. Higher-order Functions – FlatMap 00:03:28
      8. Higher-order Functions – Reduce 00:02:40
      9. Sequences and Generators 00:04:08
    3. Chapter 3 : Exploring Swift’s Memory Management
      1. What Is ARC? 00:06:15
      2. Introduction to Instruments 00:04:31
      3. Strong Reference Cycles 00:04:58
      4. Fixing our Leak – Weak and Unowned References 00:04:45
      5. Creating a Zombie 00:04:37
      6. 8 Tips to Improve Memory Performance 00:05:31
    4. Chapter 4 : Interoperability and Working with 3rd Party Libraries
      1. Implicit Bridging and Cocoa 00:05:41
      2. Exposing Swift to Objective-C 00:05:23
      3. Using Objective-C in Swift 00:04:43
      4. Interacting with C 00:05:28
      5. Wrapping C++ for Using in Swift 00:03:45
      6. Working with CocoaPods 00:05:32
      7. Incorporating an Objective-C Library 00:06:34
    5. Chapter 5 : Concurrency and Grand Central Dispatch
      1. Understanding Concurrency 00:04:11
      2. Threading with NSThread 00:04:47
      3. Locking Threads 00:03:27
      4. Asynchronous Methods 00:04:35
      5. Concurrency with NSOperationQueue 00:05:55
      6. Grand Central Dispatch 00:04:15
      7. Working with Dispatch Queues 00:04:19
      8. Asynchronous Programming with Dispatch Groups 00:06:28
    6. Chapter 6 : Troubleshooting, Advanced Debugging, and Error Handling
      1. The LLDB Debugger 00:05:31
      2. Advanced Breakpoints 00:06:59
      3. The LLDB Command Language 00:04:17
      4. Address Sanitization 00:03:38
      5. Assertions 00:04:24
      6. Error Handling 00:05:42
    7. Chapter 7 : Performance Optimization and Introduction to Algorithms
      1. Identifying Performance Bottlenecks with XCTest and Time Profiler 00:06:42
      2. Whole Module Optimization 00:06:04
      3. Reducing Dynamic Dispatch 00:03:40
      4. Reference Types and Performance 00:04:40
      5. Generic Specialization 00:04:40
      6. Choosing the Right Algorithm 00:04:55
      7. Memoization 00:07:55
    8. Chapter 8 : Design Patterns
      1. Design Patterns Overview 00:02:59
      2. Singleton Pattern 00:04:50
      3. Factory Pattern 00:05:12
      4. Adapter Pattern 00:04:58
      5. Façade Pattern 00:03:27
      6. Chain of Responsibility Pattern 00:04:42
      7. Observer Pattern 00:04:36