Join David Okun for an in-depth discussion in this video Correcting still image orientation, part of Swift: Writing Reusable Frameworks.
- [Narrator] After normalizing our image data,…the last thing we need to do is make sure we…have the correct image orientation when we…return it out of our framework.…We can do this inside the extension of…AV capture photo that we already have.…Enter a couple of lines underneath your normalized…image function, and we'll type a new function here.…This time it will be private func get…image orientation…for camera…colon camera position.…Out of this we'll make sure we return UI image orientation.…
After this, we want to run a switch statement on…our status bar orientation from our UI application.…Go ahead and type that out and type UI application…dot shared dot status bar orientation.…It's important to point out that you could…get the exif data out of the meta data returned from…AV capture photo to correct the orientation of this image.…This is a more visual way to do it, using the…status bar from the system.…Now that you've filled this out, we're going to…check each case for the status bar orientation.…We're going to use ternary operators to…
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.