ios - How to handle memory leaks in swift? -


i've finished developing first app in ios. in beginning showed 21 memory leaks. now, after completion showed 0 memory leaks . want know how memory leak occurs , how handle can solve myself if in future. thank you.

i'd @ using instruments such thing:

https://www.raywenderlich.com/97886/instruments-tutorial-with-swift-getting-started

this tutorial show how use important features of tool called instruments ships xcode. allows check code performance issues, memory issues, reference cycles, , other problems.

in tutorial you’re going learn:

  1. how determine hot-spots in code using time profiler instrument in order make code more efficient, and

  2. how detect , fix memory management issues such strong reference cycles in code using allocations instrument.