Skip to content

cemolcay/ImageFreeCut

Repository files navigation

ImageFreeCut

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

Demo

alt tag

Try

pod try ImageFreeCut

Requirements

  • Xcode 8+
  • Swift 3+
  • iOS 10+

Install

use_frameworks!
pod 'ImageFreeCut'

Usage

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published