Latest | 0.1.0 |
---|---|
Homepage | https://github.com/ZaidPathan/ZImageCropper |
License | MIT |
Platforms | ios 8.0 |
Authors |
ZImageCropper is a simplest way to crop image to any shapes you like.
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Installation
Cocoapods
ZImageCropper is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'ZImageCropper'
Manual
Add ZImageCropper.swift
and ZImageCropperView.swift
files to your project.
Usage
Crop using AI (Or programmatically)
Crop image using following code,
let croppedImage = ZImageCropper.cropImage(ofImageView: yourImageView, withinPoints: [
CGPoint(x: 0, y: 0), //Start point
CGPoint(x: 100, y: 0),
CGPoint(x: 100, y: 100),
CGPoint(x: 0, y: 100) //End point
])
Note : Make sure you provide valid points, points must be >=2 in count.
Crop using user touches,
Step 1: Add UIImageView
to your StoryBoard/XIB
and give it a Class Name: ZImageCropperView
Step 2: Run the app and see cropping is enable to your UIImageView
Step 3: Add @IBOutlet
of your UIImageView
and call method imageView.cropImage()
to crop selected layer by user.
Author
Zaid Pathan
Contributor
License
ZImageCropper is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "ZImageCropper", "version": "0.1.0", "summary": "A Swift 5 repo to crop image in any shape.", "description": "TODO: Add long description of the pod here.", "homepage": "https://github.com/ZaidPathan/ZImageCropper", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "ZaidPathan": "[email protected]" }, "source": { "git": "https://github.com/ZaidPathan/ZImageCropper.git", "tag": "0.1.0" }, "platforms": { "ios": "8.0" }, "swift_versions": "4.2", "source_files": "ZImageCropper/Classes/*.swift", "swift_version": "4.2" }
Wed, 29 May 2019 10:19:04 +0000