测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可 | MIT |
Released最新版本 | 2017年8月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 pikachu987 维护。
要运行示例项目,请先克隆仓库,然后从 Example 目录运行 pod install
。
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)
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)
}
}
}
PKCCrop 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile:
pod "PKCCrop"
pikachu987,[email protected]
PKCCrop 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。