Join David Okun for an in-depth discussion in this video Implement AVFoundation delegates, part of Swift: Writing Reusable Frameworks.
- [Instructor] Now that we've set up our camera framework…to tell AvFoundation to capture a still image,…let's go ahead and get that image data…out of the delegate that AVFoundation gives us.…On line 54 you'll notice that we set up our photo output…to capture a photo using a set of AV capture photo settings…adhering to a certain delegate.…However, you'll notice that we haven't yet…made our camera object adhere to that delegate.…So let's go ahead and set that up now.…Scroll down to the bottom of your camera.swift file…and create another extension.…You'll want to make sure that you extend camera…while making that extension adhere…to the AVCapturePhotoCaptureDelegate.…
Open your curly brackets and before you continue,…make sure you mark this extension properly…as still photo capture to organize your code.…Go into your extension and this time,…instead of letting us auto complete a function…that we want out of this delegate,…hold the Command key on your keyboard,…and click on AVCapturePhotoCaptureDelegate.…Jump into that definition, go up the top toolbar,…
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.