You have to handle rotation first. No one has ever been excited to take a legacy application and then have to add support for device orientation throughout the entire app for every use case. Learn the simple things you have to keep in mind for a camera, and how your users actually use the device for its purpose when implementing your framework.
- [Instructor] We've done a lot of great work so far…setting up our framework to handle all sorts of events.…But we need to make sure we check…for a couple of common edge cases before we proceed.…If you try to run the SampleApplication to this point,…and you look at the SampleApplication,…you'll notice that everything runs as expected.…But what happens if we try to rotate the phone to the left?…You'll notice that the output is not very pretty.…Let's go ahead and fix this.…To start, we'll want to scroll up to the base declaration…of our view controller, and we'll implement a function…called viewWillLayoutSubviews.…
Scroll up underneath viewWillAppear,…and type viewWillLayoutSubviews.…You'll notice that it fills in…the public and override for you…to handle access control correctly.…Go ahead and type in super.viewWillLayoutSubviews…to handle any super calls to its class.…Now scroll down to your UI extension,…and we want to add two function signatures…underneath createUI.…The first one will be updateUI,…and the parameter that we'll pass in is called orientation,…
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
Learning Swift Playgrounds Application Developmentwith Steven Lipton2h 58m Intermediate
Swift 4: Protocol-Oriented Programmingwith Károly Nyisztor1h 44m Intermediate
Swift: Delegations and Data Sourceswith Steven Lipton31m 49s Beginner
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.