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
Skill Level Intermediate
Learning Server-Side Swift with Vaporwith Ron Buencamino1h 30m Intermediate
Swift 4: Protocol-Oriented Programmingwith Károly Nyisztor1h 44m Intermediate
1. Let's Make It Work
2. Let's Keep It Clean
3. Putting It All Together
4. Track It
Tagging releases in Git2m 36s
Next steps1m 47s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.