Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/powermobileweb/imagecut

A UIView subclass lets you draw a path over an image and crops that part.
https://github.com/powermobileweb/imagecut

image-processing imagecutter ios ios-swift iphone-app mobile-app swift

Last synced: 17 days ago
JSON representation

A UIView subclass lets you draw a path over an image and crops that part.

Awesome Lists containing this project

README

        

ImageCut
===

A UIView subclass lets you draw a path over an image and crops that part.

Demo
----

![alt tag](https://github.com/powermobileweb/ImageCut/raw/master/Demo.gif)

#### Try

``` sh
pod try ImageFreeCut
```

Requirements
----

* Xcode 8+
* Swift 3+
* iOS 10+

Install
----

``` ruby
use_frameworks!
pod 'ImageFreeCut'
```

Usage
----

``` swift
import ImageFreeCut
```

You can either use storyboard or create it programmatically like any UIView.
Notice that view's class name is `ImageFreeCutView`.

```
open var imageToCut: UIImage?
```
Sets the image of `ImageFreeCutView`. You are going to crop that one.

```
open var imageView: UIImageView!
```
You can set the imageView's properties like `contentMode` directly from your `ImageFreeCutView` instance.

```
open var imageCutShapeLayer: CAShapeLayer!
```
You can set cut layer's properties like `strokeColor`, `fillColor`, `dashPattern` directly from your `ImageFreeCutView` instance.

ImageFreeCutViewDelegate
----
Set your instance delegate and implement

```
func imageFreeCutView(_ imageFreeCutView: ImageFreeCutView, didCut image: UIImage?)
```

delegate method to retrive cropped image.