- Put an UIScrollView at the size you want using Storyboard
- Use ImageCropView's setup() function to init the component
- After the UI is rendered you can call the display() function
- Let the user zoom & move the image as they want
- Get the cropped image by using croppedImage() function
- Get the crop rect by using cropRect() function
- Tap events can be handled using ImageCropViewTapProtocol
- You can use this component to display a read only cropped image too
- iOS 8.0+
- Xcode 7.0+
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
CocoaPods is a dependency manager for Cocoa projects.
CocoaPods 0.38.2 is required to build ImageCropView. It adds support for Xcode 7, Swift 2.0 and embedded frameworks. You can install it with the following command:
$ gem install cocoapods
To integrate ImageCropView into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'ImageCropView', '~> 1.0'
Then, run the following command:
$ pod install
imageCropView.setup(UIImage)
imageCropView.display()
let croppedImage = imageCropView.croppedImage()
let cropRect = imageCropView.cropRect()
imageCropView.setCrop(rect)
ImageCropView is released under the MIT license. See LICENSE for details.