Visual Swift Memory Mastery

In this course, you'll learn about how memory leaks happen, how to find them, how to fix them, and plenty of tips and tricks along the way

Course curriculum

  • 1


    • Welcome

    • Resources

    • Where to Get Help?

  • 2

    Introduction from Mark Moeykens

    • Introduction from Mark Moeykens

  • 3

    What Are Value Types and Reference Types?

    • Memory Basics

    • Value Types

    • Playgrounds: Value Types

    • Word Review: Value Type

    • Reference Types

    • Playgrounds: Reference Types

    • Word Review: Reference Type

    • Demonstration: Value Types & Reference Types in Xcode

    • Summary

    • Swift Language Reference: Value and Reference Types

    • Remember This!

  • 4

    Easily Find Leaks and Fix Them with This Little-known 2-Step Method

    • Memory Leaks Introduction

    • What You Are Going To Learn

    • Removing Reference Types from Memory

    • Automatic Reference Counting (ARC)

    • Demonstration: ARC

    • Word Review: Allocate

    • Word Review: Deallocate

    • Word Review: Initialization

    • Word Review: Deinit

    • Dependencies: Children Can Cause Trouble

    • Demonstration: Dependencies

    • Sad Orphans

    • Demonstration: Retain Cycles

    • Using Instruments: Leak Profiler

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

    • Demonstration: Fixing Retain Cycles

    • Playgrounds with Retain Cycle

    • Overview of the Strong, the Weak and the Unowned

    • Example of the Strong, the Weak and the Unowned

    • Would You Rather Be Weak or Unowned?

    • Playgrounds: Create Retain Cycles

    • Word Review: Retain Cycle

    • Summary

    • Remember This!

  • 5

    Finally Understand What Closures Are and How to Fix Memory Problems They Are Creating in Your App Right Now

    • Introduction

    • What is a Closure?

    • Demonstration

    • Closures Are Reference Types

    • Word Review: Closure

    • Capturing Values

    • Capture Lists

    • Demonstration

    • More on Capture Lists

    • Word Review: Capture List

    • Summary

    • Remember This!

  • 6

    Introduction: Never Get Surprised by These Common Memory Problems Again

    • Introduction

    • What You Will Learn

    • Reusable Popup Project

  • 7

    Beware of Notification Center Closures

    • Overview

    • Solution with Weak

    • Solution with Capture List

    • Avoid Extras in Memory

    • Remember This!

  • 8

    Callbacks Can Be Your New Best Friend but Make Sure You Do This One Thing to Avoid Memory Leaks

    • Overview

    • Solution with Weak

    • Solution with Capture List

    • Solution with Nil

    • Remember This!

    • Summary of Solutions

  • 9

    Learn the Most Common Practice When Working with Delegates

    • Overview

    • Solution with Weak

    • A Weaker Solution

    • Solution with Nil

    • Summary of Solutions

    • Remember This!

  • 10

    Summary: Now You Know More Than 85% Of All iOS Developers!

    • Swift Memory Mastery Summary

  • 11


    • Which property in this class could cause a retain cycle and why?

    • What are the 2 steps to fixing a retain cycle?

    • The weak and unowned keywords prevent automatic reference counting (ARC) from incrementing the reference count.

    • The variable "theView" will be: Strong, Weak or Unowned?

    • Value types such as Int, String, Bool, Array, Dictionary, can cause retain cycles.

  • 12

    [BONUS] Interview Preparation with Memory Questions

    • Job Interview Practice

  • 13

    A Deeper Look Into Memory

    • Where Are Objects Stored?