Find View in View Hierachi
Memory usage graph
Memory leak debug with Xcode Instruments
What is Xcode Instruments?
Xcode Instruments is best described as a powerful and flexible performance-analysis and testing tool. It’s part of the Xcode toolset which also includes tools like Create ML and the Accessibility Inspector.
The instruments can be used to:
Track down problems in your source code
Analyze the performance of your app
Find memory problems
And a lot more!
Main Thread Checker in Xcode
How to enable Main Thread Checker ?
Edit scheme.
Select run scheme.
Select the Diagnostics tab.
Check the Main Thread Checker Check Box.
Click on small arrow written besides MTC text (Optional).
On click on arrow message besides main thread checker will add breakpoint for the project for debugging.
How does this function works ?
During runtime it will check if all UI and other code which should be run in main thread is working or not, incase it is not working it will pause at the line of code which should be put in main thread along with appropriate warning message.
If main thread debugger break point is not added and one wish to identify issues without that then you can get a look at the list of all the main thread issues in runtime error messages.
References
https://www.hackingwithswift.com/read/9/4/back-to-the-main-thread-dispatchqueuemain