Latest 0.0.8
Homepage https://github.com/February12/YLImagePickerController
License MIT
Platforms ios 8.0, requires ARC
Dependencies TOCropViewController
Authors

YLPhotoBrowser

界面界面

界面 界面

选择相册和拍照 支持多种裁剪

希望

  • 如果您在使用时发现错误,希望您可以 Issues 我

  • 如果您发现使用的功能不够,希望您可以 Issues 我

导入

pod 'YLImagePickerController'

使用

var imagePicker:YLImagePickerController?

///单选不裁剪
imagePicker = YLImagePickerController.init(imagePickerType: ImagePickerType.album, cropType: CropType.none) 
///单选方形裁剪
imagePicker = YLImagePickerController.init(imagePickerType: ImagePickerType.album, cropType: CropType.square)
///拍照不裁剪
imagePicker = YLImagePickerController.init(imagePickerType: ImagePickerType.album, cropType: CropType.circular)
///多选
imagePicker = YLImagePickerController.init(maxImagesCount: 3)
///拍照不裁剪
imagePicker = YLImagePickerController.init(imagePickerType: ImagePickerType.camera, cropType: CropType.none)
///拍照方形裁剪
imagePicker = YLImagePickerController.init(imagePickerType: ImagePickerType.camera, cropType: CropType.square)

/// 可以选择GIf
imagePicker?.isNeedSelectGifImage = true
/// 可以选择视频
imagePicker?.isNeedSelectVideo = true

/// 导出图片
imagePicker?.didFinishPickingPhotosHandle = {(photos: [YLPhotoModel]) in
      for photo in photos {
          if photo.type == YLAssetType.photo {
              print((UIImagePNGRepresentation(photo.image!)?.count)! / 1024)
          }else if photo.type == YLAssetType.gif {
              print((photo.data?.count)! / 1024)
          }else if photo.type == YLAssetType.video {
              print("视频")
          }
      }
}

present(imagePicker!, animated: true, completion: nil)

最近更新

  • 0.0.8 添加视频功能
  • 0.0.7 添加预览功能
  • 0.0.6 添加GIF功能
  • 0.0.5 添加原图功能

Latest podspec

{
    "name": "YLImagePickerController",
    "version": "0.0.8",
    "summary": "u9009u62e9u76f8u518cu548cu62cdu7167 u652fu6301u591au79cdu88c1u526a",
    "description": "u81eau5b9au4e49u76f8u518cu548cu81eau5b9au4e49u62cdu7167 u652fu6301u591au79cdu88c1u526a",
    "homepage": "https://github.com/February12/YLImagePickerController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "yl": "[email protected]"
    },
    "source": {
        "git": "https://github.com/February12/YLImagePickerController.git",
        "tag": "0.0.8"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": [
        "Sources/**/*.swift",
        "Sources/**/*.xib"
    ],
    "resource_bundles": {
        "YLImagePickerController": [
            "Sources/**/*.png"
        ]
    },
    "requires_arc": true,
    "dependencies": {
        "TOCropViewController": [
            "~> 2.0.12"
        ]
    },
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This