Latest 2.1.0
Homepage https://github.com/miller-ms/MMSCropView
License MIT
Platforms ios 9.0, requires ARC
Authors

CI Status
Version
License
Platform
Readme Score

This class provides the feature to draw a rectangle over an image by dragging a finger over it, move it, and extract the covered region into a UIImage.

Example

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

In your storyboard select the custom class MMSCropImageView for the Image View widget.

Import the class header.

import MMSCropView

Add an event handler to initiate the crop action and call the crop method on the image view.

@IBAction func crop(sender: UIButton) {

    let croppedImage = originalImageView.crop()

    croppedImageView.image = croppedImage

}

Requirements

  • MMSCropView requires iOS 8.3 or later.
  • Swift 3.0.

Installation

MMSCropView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "MMSCropView"

Author

William Miller, [email protected]

Article

An article describing the implementation of the class: A View Class for Cropping Images.

Contact

William Miller

License

This project is is available under the MIT license. See the LICENSE file for more info. Attribution by linking to the project page is appreciated.

Latest podspec

{
    "name": "MMSCropView",
    "version": "2.1.0",
    "summary": "A view controller supporting the feature to crop an image.",
    "description": "This class supports the feature for dragging a rectangle over a UIImageView and returning a UIImage with the pixels beneath the crop rectangle cropped from the underlying image.",
    "homepage": "https://github.com/miller-ms/MMSCropView",
    "screenshots": "https://raw.githubusercontent.com/miller-ms/MMSCropView/master/screenshot.png",
    "license": "MIT",
    "authors": {
        "William Miller": "[email protected]"
    },
    "source": {
        "git": "https://github.com/miller-ms/MMSCropView.git",
        "tag": "2.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This