artemkrachulov / AKImageCropperView

Responsive image cropper
MIT License
172 stars 66 forks source link

Swift 3.0 support #6

Open sneps85 opened 7 years ago

sneps85 commented 7 years ago

Swift 3.0 support would be nice for your great cropper!

dahikarShashant commented 7 years ago

I am expecting the same thing. Please update on this. Thanks!

adinertia commented 7 years ago

If you need support for swift 3 you need to change / add just these:

First you need to add in info.plist these settings:

NSPhotoLibraryUsageDescription This app requires access to the photo library. NSCameraUsageDescription This app requires access to the camera.

Then you need to update 2 for loops in file AKImageCropperView.swift Line 580.. from: for (var i = 1; i <= gridLines; i += 1) {
to: for i in 1...gridLines{

And in line 590 the same as above.

And finaly change the line in 434 from: scroll.insetInPlace(dx: scrollViewActiveOffset, dy: scrollViewActiveOffset) to: scroll.insetBy(dx: scrollViewActiveOffset, dy: scrollViewActiveOffset)

That's it, and you will have swift 3 support.

khushDesai commented 6 years ago

i am using swift 3.0 and i have implemented this library for cropping in my Photo Editing app. i need to add Image Rotation Feature as an iPhone Provides by default as shown in image. when you are going to edit any image. how can i achieve this. i have tried to rotate image but it rotating that cropper view also. Please Help!

iphone-6-cropper