Instruments Tutorial with Swift: Getting Started | raywenderlich.com

In this Xcode tutorial, you’ll learn how to use Instruments to profile and debug performance, memory and reference issues in your iOS apps.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/16126261-instruments-tutorial-with-swift-getting-started

Yesterday night I spend an hour following through this tutorial. Today I used what I learned to find 2 strong reference cycles in the app I’m working on at my day job. I used the Allocations Instrument to initially find out that 2 view controllers were not being deallocated when they were dismissed and then I used the Debug Memory Graph to find out where exactly was the problem. I was assigning a closure to a collection view cell like in the tutorial. I already new about weak self references so I was already weakly capturing self. The problem was that I was using the new closure based way of doing UICollectionViews in iOS 13/14 so I was strongly capturing self from the UICollectionViewDiffableDataSource closure. Thank you very much Lea for the tutorial!

Hi! This is a great tutorial! I was having one issue. When I attempt to double click rows in the Time Profiler as described here the associated code is not displayed:

I’m using Xcode 13.3 on macOS 12.4. Have you seen this issue before? Thanks!

-Nick