The worst problems that happen in software development are the ones that happen behind the curtains. Use the memory profiler in Xcode to examine the performance of your camera in different situations, and then introduce a deliberate memory leak into the camera so you can see what a memory leak looks like, how to debug it, and how to make sure you write clean code—protecting your framework against situations like that.
- [Instructor] Before we get ready…to start shipping our framework,…and make it releasable, it's very, very important…to make sure that you're always checking for memory leaks…in any application or framework that you work with.…Let's go over how to enable the memory debugger in Xcode 9.…Go up to your schemes, and click on Edit Scheme…for your SampleApplication.…In the Run tab, you'll initially end up…on the Info screen here.…Go to the right and click on Diagnostics.…Go down to where it says Logging,…click on Malloc Stack, and under the options…you have here, click on Live Allocations Only.…
The reason we're choosing Live Allocations Only…is because automatic resource counting…will take care of most of our work for us.…We'll need to focus on what's live…on the stack that we're working with.…Click on Close, and go ahead and run your application.…As we've been working on this,…we've actually built in a retain cycle…into our application, that we know how to debug…now that we have the memory debugger.…Let's go ahead and show that so we can access…
Along the way, he explains the differences and nuances between writing code for an application and for a reusable framework, as well as some of the fundamentals of AVFoundation, one of the core camera frameworks in iOS. David also shows how to refactor your code, understand Swift access control, develop an interface, and handle memory leaks, so your framework is ready to share with other developers.
- Creating your first build
- Making the camera work
- Creating a framework delegate
- Adding media
- Capturing images
- Correcting orientation
- Versioning and tagging releases in Git