CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

PKCCrop 0.2.4

PKCCrop 0.2.4

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Aug 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by pikachu987.



PKCCrop 0.2.4

  • By
  • pikachu987

PKCCrop

example Image

image image image

image image

Example

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



- ViewController


PKCCropHelper.shared.degressBeforeImage = UIImage(named: "pkc_crop_rotate_left.png")
PKCCropHelper.shared.degressAfterImage = UIImage(named: "pkc_crop_rotate_right.png")
PKCCropHelper.shared.isNavigationBarShow = false
let cropVC = PKCCrop().cropViewController(UIImage(named: "image.jpeg")!)
cropVC.delegate = self
self.present(cropVC, animated: true, completion: nil)


- PKCCrop Delegate


extension ViewController: PKCCropDelegate{

    //return Crop Image & Original Image
    func pkcCropImage(_ image: UIImage?, originalImage: UIImage?) {

    }

    //If crop is canceled
    func pkcCropCancel(_ viewController: PKCCropViewController) {
        viewController.navigationController?.popViewController(animated: true)
    }

    //Successful crop
    func pkcCropComplete(_ viewController: PKCCropViewController) {
        if viewController.tag == 0{
            viewController.navigationController?.popViewController(animated: true)
        }else{
            viewController.dismiss(animated: true, completion: nil)
        }
    }

}



Installation

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

pod "PKCCrop"

Author

pikachu987, [email protected]

License

PKCCrop is available under the MIT license. See the LICENSE file for more info.