Visual Swift Memory Mastery

Learn the fundamentals of memory management for iOS/macOS and build memory-performant apps!

Course Requirements

  • Mac running macOS Monterey 12.5 or later, Xcode 14 (Swift 5.7)

What You'll Learn

  • Reference and Value Types in Swift

    Learn about the different memory mechanisms of reference and value types for a better intuition of when to use them.

  • ARC and the Reference Counting System

    Learn about how reference counting works, what retain cycles are, and how iOS/macOS handles memory with Automatic Reference Counting (ARC).

  • Understanding Memory Problems

    Learn about the different memory problems developers commonly face when building an app, and what safe practices can be made to solve these problems.

  • Detecting and Fixing Memory Leaks

    Unmanaged memory leaks cause sudden and unexpected crashes. Learn how to detect and fix memory leaks by identifying them in code or by using Instruments.

  • Memory Implications of Swift Closures

    Swift closures can easily cause a crash when poorly implemented. Learn about how Swift closures can affect memory and what practices can be done to promote safety.

  • Safe Practices with Delegates

    Delegation is one of the most common patterns that most developers have used when building iOS/macOS apps. Learn safe practices when using delegates to avoid leaks or unexpected crashes.

Why This Course?

  • Improve App Performance

    Mastery of memory management can help you build high-performance apps. Need to show a photo gallery of a million images without crashing the app or slowing down scroll performance? Knowledge of efficient memory management is the key.

  • Improve App Stability

    Prevent unnecessary slowdowns or unexpected crashes due to poor implementation of memory management.

  • Ace Interviews and Get Hired

    Memory management is always a part of technical interviews as it allows interviewers to gauge if a developer can write safe and performant Swift code while having the ability to fix issues relating to memory and optimize code for better memory performance.

Course curriculum

    1. Welcome

    2. Resources

    3. Where to Get Help?

    1. Introduction from Mark Moeykens

    1. Memory Basics

    2. Value Types

    3. Playgrounds: Value Types

    4. Word Review: Value Type

    5. Reference Types

    6. Playgrounds: Reference Types

    7. Word Review: Reference Type

    8. Demonstration: Value Types & Reference Types in Xcode

    9. Summary

    10. Swift Language Reference: Value and Reference Types

    11. Remember This!

    1. Memory Leaks Introduction

    2. What You Are Going To Learn

    3. Removing Reference Types from Memory

    4. Automatic Reference Counting (ARC)

    5. Demonstration: ARC

    6. Word Review: Allocate

    7. Word Review: Deallocate

    8. Word Review: Initialization

    9. Word Review: Deinit

    10. Dependencies: Children Can Cause Trouble

    11. Demonstration: Dependencies

    12. Sad Orphans

    13. Demonstration: Retain Cycles

    14. Using Instruments: Leak Profiler

    15. How to Fix a Retain Cycle with the 2-Step Method

    16. Demonstration: Fixing Retain Cycles

    17. Playgrounds with Retain Cycle

    18. Overview of the Strong, the Weak and the Unowned

    19. Example of the Strong, the Weak and the Unowned

    20. Would You Rather Be Weak or Unowned?

    21. Playgrounds: Create Retain Cycles

    22. Word Review: Retain Cycle

    23. Summary

    24. Remember This!

    1. Introduction

    2. What is a Closure?

    3. Demonstration

    4. Closures Are Reference Types

    5. Word Review: Closure

    6. Capturing Values

    7. Capture Lists

    8. Demonstration

    9. More on Capture Lists

    10. Word Review: Capture List

    11. Summary

    12. Remember This!

    1. Introduction

    2. What You Will Learn

    3. Reusable Popup Project

About this course

  • Free
  • 79 lessons
  • 1.5 hours of video content

Get Access to this course with a CWC+ Membership

With a membership, you'll get access to all of our programs, structured learning paths and training courses to help you become an iOS developer or indie app developer.

Learn More