Latest 0.5.4
Homepage https://github.com/IAskWind/IAWExtensionTool
License MIT
Platforms ios 9.0, requires ARC
Dependencies SnapKit, SVProgressHUD, RNCryptor, Alamofire, AlamofireObjectMapper, Kingfisher, CryptoSwift, MJRefresh, SKPhotoBrowser, OMExtension, SlideMenuControllerSwift, SwiftMessages
Frameworks UIKit, Foundation, QuartzCore, JavaScriptCore, AVFoundation
Authors

CI Status
Version
License
Platform

Example

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

Requirements

Installation

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

pod "IAWExtensionTool"

权限 网络请求 相册 照相机

![权限图](./权限.png =500×300)

实例 评分控件 RatingBar https://github.com/IAskWind/RatingBar

      func dealCommonRatingBar(_ dealView:UIView,title:String,ratingBarTag:Int){
    dealView.width = SCREENW

    dealView.backgroundColor = UIColor.white
    let styleLabel = setupLabel(title)
    dealView.addSubview(styleLabel)
    styleLabel.snp.makeConstraints{
        (make) in
        make.top.equalTo(dealView)
        make.left.equalTo(10)
        make.height.equalTo(labelHeight)
        make.width.equalTo(80)
    }

    let ratingBar = RatingBar()
    ratingBar.frame = CGRect(x: 0, y: 0, width: 100, height:50)
    ratingBar.setSeletedState("star_big1", halfSelectedName: "star_big2", fullSelectedName: "star_big3", starSideLength: 35, delegate: self)
    ratingBar.displayRating(0)
    ratingBar.isIndicator = false
    ratingBar.supportHalfStar = false
    ratingBar.tag = ratingBarTag
    dealView.addSubview(ratingBar)
    ratingBar.snp.makeConstraints{
        (make) in
        make.top.equalTo(styleLabel.snp.bottom)
        make.centerX.equalTo(dealView)
        make.width.equalTo(ratingBar.width)
        make.height.equalTo(50)
    }
    dealView.height = 100

}

实例 图片截取 https://github.com/sprint84/PhotoCropEditor

继承 UINavigationControllerDelegate, UIImagePickerControllerDelegate, CropViewControllerDelegate

func cropImg(img:UIImage){
    let controller = CropViewController()
    controller.delegate = self
    controller.image = img

    let navController = UINavigationController(rootViewController: controller)
    present(navController, animated: true, completion: nil)

}

 // MARK: - CropView
func cropViewController(_ controller: CropViewController, didFinishCroppingImage image: UIImage) {
    print("12323")
    //        controller.dismissViewControllerAnimated(true, completion: nil)
    //        imageView.image = image
    //        updateEditButtonEnabled()
}

func cropViewController(_ controller: CropViewController, didFinishCroppingImage image: UIImage, transform: CGAffineTransform, cropRect: CGRect) {
    controller.dismiss(animated: true, completion: nil)
    uploadImg.tag = 1
//   image.imageOrientation = .right

       uploadImg.image = image
    // 照片处理好,显示图层

//        updateEditButtonEnabled()
}

func cropViewControllerDidCancel(_ controller: CropViewController) {
    controller.dismiss(animated: true, completion: nil)
//        updateEditButtonEnabled()
    print("取消")
    resetUIAndToMain()
}

// MARK: - UIImagePickerController delegate methods
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
    guard let image = info[UIImagePickerControllerOriginalImage] as? UIImage else {
        dismiss(animated: true, completion: nil)
        return
    }
//        uploadImg.image = image
//        cropImg(img: image)

    dismiss(animated: true) { [unowned self] in
//            self.openEditor(nil)
//            self.uploadImgClick(nil)
        self.cropImg(img: image)
    }
}

func imagePickerControllerDidCancel(_ picker: UIImagePickerController){
     self.dismiss(animated: true, completion: nil)
    resetUIAndToMain()
}

Author

IAskWind, [email protected]

License

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

Latest podspec

{
    "name": "IAWExtensionTool",
    "version": "0.5.4",
    "summary": "A short description of IAWExtensionTool.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/IAskWind/IAWExtensionTool",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "IAskWind": "[email protected]"
    },
    "source": {
        "git": "https://github.com/IAskWind/IAWExtensionTool.git",
        "tag": "0.5.4"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "IAWExtensionTool/IAWExtensionTool/Classes/**/*",
    "requires_arc": true,
    "resource_bundles": {
        "IAWExtensionTool": [
            "IAWExtensionTool/IAWExtensionTool/Resources/**/*"
        ]
    },
    "frameworks": [
        "UIKit",
        "Foundation",
        "QuartzCore",
        "JavaScriptCore",
        "AVFoundation"
    ],
    "dependencies": {
        "SnapKit": [
            "~> 3.2.0"
        ],
        "SVProgressHUD": [],
        "RNCryptor": [],
        "Alamofire": [
            "~> 4.0"
        ],
        "AlamofireObjectMapper": [
            "~> 4.0"
        ],
        "Kingfisher": [
            "~> 3.2.4"
        ],
        "CryptoSwift": [
            "~> 0.6.9"
        ],
        "MJRefresh": [],
        "SKPhotoBrowser": [
            "~> 4.0.0"
        ],
        "OMExtension": [],
        "SlideMenuControllerSwift": [],
        "SwiftMessages": []
    },
    "pushed_with_swift_version": "3.2"
}

Pin It on Pinterest

Share This