In iOS application development, the running joke is that MVC doesn't stand for model-view-controller, but instead massive-view-controller. In this video, learn that nobody likes frameworks with overbearing chunks of code either, and see how you can use extensions, coupled with the right access control, to make your code more organized, and most importantly, easier to read.
- [Instructor] Let's talk about how we can use extensions…to organize your reusable swift code.…So far we've been working with camera view controller…which is a class of type UI view controller.…And we've kept everything inside one class declaration here.…But you've probably noticed that one of these things…is not like the other.…We have things like view will appear, required public init,…and all of all our stored properties…which are things that are going to have to go…in the type of class UI view controller.…But this function for create UI could probably be…organized a bit further.…And we can separate that from the rest of our logic…so that whenever somebody is working with this framework,…they have an easy way to tell where it is.…
We can use an extension to silo that logic…into its own place in our code.…To do this, scroll to the bottom of your class…and hit return a couple of times outside…of your class declaration.…Then you want to type file private extension…camera view controller.…It's important to point that whenever you're creating…
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