/ImageCropView

UI component to display an image you can crop, or a cropped image

Primary LanguageSwiftMIT LicenseMIT

ImageCropView

ImageCropView allow you to easily display and crop images

Features

  • 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

Requirements

  • iOS 8.0+
  • Xcode 7.0+

Communication

  • 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.

Installation

CocoaPods

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

Usage

Setup
imageCropView.setup(UIImage)
Display
imageCropView.display()
Get the cropped image
let croppedImage = imageCropView.croppedImage()
Get the crop Rect
let cropRect = imageCropView.cropRect()
Set the crop Rect
imageCropView.setCrop(rect)

License

ImageCropView is released under the MIT license. See LICENSE for details.