Latest 1.0.6
Homepage https://github.com/turkeyaa/TAssetPicker
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit, Foundation
Authors

An integration of Photos which allows you to pick media(image/video) effortlessly, with circular crop supported, and written in Swift

Picture

Dynamic graph

Usage

TAssetPicker works as a normal controller, just instantiate it and present it.

let vc = AssetPickerController()
vc.assetResult = { (result: [UIImage]) in
    print(result)   // UIImage 数组对象
}
vc.errorResult = { (index: Int) in
    if index == 0 {
        print("只能选择(configu.maxCount)张图片")
    }
}
present(vc, animated: true, completion: nil)

Optional bonus

Configuration

You can inject Configuration instance to TAssetPicker, which allows you to configure text, colors,image, fonts, supports limiting the amount of images that can be selected, it defaults
to zero, which means that the user can select as many images as he/she wants.

/// 导航栏标题
let configu = AssetConfiguration.init()
configu.leftTitle = "取消"
configu.rightTitle = "完成"

configu.leftImage = UIImage.init(named: "d_close")
configu.rightImage = UIImage.init(named: "d_complete")

/// 选择 or 反选图片,必须
configu.selectImage = UIImage.init(named: "select")
configu.deselectImage = UIImage.init(named: "deselect")

configu.maxCount = 9  // 可选中图片个数

configu.numberBgColor = UIColor.red     // 数量背景颜色

let vc = AssetPickerController.init(configu: configu)

Installation

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

pod 'TAssetPicker'

TAssetPicker is also available through turkeyaa. manually: drag ‘Classes’ in TAssetPicker/Classes to your project, make sure to check copy items if needed

Requirements

iOS 8.0

Contribution

Author

Wenhua Yu, [email protected]

License

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

Latest podspec

{
    "name": "TAssetPicker",
    "version": "1.0.6",
    "platforms": {
        "ios": "9.0"
    },
    "summary": "Photos for swift",
    "description": "An integration of  Photos.framework which allows you to pick image effortlessly, with circular crop supported, and written in Swift",
    "homepage": "https://github.com/turkeyaa/TAssetPicker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "turkeyaa": "[email protected]"
    },
    "source": {
        "git": "https://github.com/turkeyaa/TAssetPicker.git",
        "tag": "1.0.6"
    },
    "source_files": "TAssetPicker/**/*.{swift}",
    "resource_bundles": {
        "TAssetPicker": [
            "TAssetPicker/Resource/*.{png}"
        ]
    },
    "requires_arc": true,
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    }
}

Pin It on Pinterest

Share This