Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Cropping Images (Swift): Custom crop frame size

Hi everybody,

I'm looking to allow users to crop an image with dimensions 320x200. Using UIImagePickerController and enabling editing, I'm only allowed the standard 320x320 crop frame. I've looked all over and I've found a few libraries written in Objective-C (GKImagePicker) that will allow a custom frame. Wondering if anyone has come across a Swift library or accomplished something like this themselves in Swift. Please let me know. I'd greatly appreciate it!

Thank you

GKImagePicker: https://github.com/gekitz/GKImagePicker

1 Answer

Hey, Aaron

You can use Obj-C libraries with Swift you know? Just use a bridging header to import your statements. A simple google search would have found you the solution.

Thanks, Alex

Thanks, Alex - familiar with Google & with using bridging headers as I have one in my app. However, I am having issues and wondering if there was one that was entirely written in Swift already.

What's your issue, I can have a go at solving the issue for you.