Latest 0.4.0
License MIT
Platforms ios 8.0
Frameworks UIKit, Photos, AssetsLibrary, AVFoundation, ImageIO

English | 中文

A Lightweight image selection framework

CI Status


  • A Lightweight image selection framework, Low memory consumption
  • Support Device orientation and iPad
  • Almost identical to the UIImagePickerController interface, easy to get started
  • Convenient preview function
  • A lot of small details




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


  • iOS > 8.0
  • swift >= 3.0


  • TTAImagePickerController is available through CocoaPods. To install
    it, simply add the following line to your Podfile:pod "TTAImagePickerController"

  • Manual import:
    Drag and drop All files in the TTAImagePickerController folder to project, import the main file:import TTAImagePickerController

How to use

1. Create

// Create the image picker with the assets that you had selected which will show as selected in the picker
let imagePicker = TTAImagePickerController(selectedAsset: selectedAssets)
// Set pickerDelegate
imagePicker.pickerDelegate = self
// Set allow take picture in the picker, default: true
imagePicker.allowTakePicture = allowTakePickerSwitch.isOn
// Set allow user delete images in the picker, default: false
imagePicker.allowDeleteImage = allowDeleteImageSwitch.isOn
// Set support large titles for iOS 11
imagePicker.supportLargeTitles = showLargeTitles.isOn
// Set the max pick number, default is 9
imagePicker.maxPickerNum = Int(maxImageCountTextField.text ?? "9") ?? 9

// You can custom the picker apperance
// imagePicker.selectItemTintColor = .red
// imagePicker.barTintColor = .orange
// imagePicker.tintColor = .cyan

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

2. Confirm and implement delegate

// implement the delegate method and when finished picking, you will get the images and assets that you have selected
func imagePickerController(_ picker: TTAImagePickerControllerCompatiable, didFinishPicking images: [UIImage], assets: [TTAAsset]) {
    print("got the images")
    selectedImages = images
    selectedAssets = assets

Extra function you can get

// On the other hand, you can preview the images directly and deselected some of them
// What you need to do:
// Create a instance of `TTAPreviewViewController` (dependency the delegate in step 2)
extension ViewController: UICollectionViewDelegate {
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        collectionView.deselectItem(at: indexPath, animated: true)
        let previewVc = TTAPreviewViewController(selected: selectedAssets, index: indexPath.item, delegate: self)
        present(previewVc, animated: true, completion: nil)

Recnet Add

  • 20170917

    Fix reselected and delete image error
    Add iOS 11 support
    Add iPhone support

  • 20170820

    Add Camera Support
    Support Image deleteation in picker

  • 20170806

    Gif Support
    Video Support

What to do next

  1. Your advice is welcome


TobyoTenma, [email protected]


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

Latest podspec

    "name": "TTAImagePickerController",
    "version": "0.4.0",
    "summary": "A Lightweight image selection framework/u4e00u4e2au8f7bu91cfu7ea7u56feu7247u9009u62e9u6846u67b6",
    "description": "A Lightweight image selection frameworkn* A Lightweight image selection framework, Low memory consumptionn* Support Device orientation and iPadn* Almost identical to the `UIImagePickerController` interface, easy to get startedn* Convenient preview functionn* A lot of small detailsnnu4e00u4e2au8f7bu91cfu7ea7u56feu7247u9009u62e9u6846u67b6n* u4e2au8f7bu91cfu7ea7u56feu7247u9009u62e9u6846u67b6,u5185u5b58u5360u7528u4f4en* u9002u914du5c4fu5e55u65cbu8f6cu548c iPadn* u4e0e `UIImagePickerController` u76f8u4f3cu7684u63a5u53e3, u5bb9u6613u4e0au624bu4f7fu7528n* u4fbfu6377u80e1u56feu7247u9884u89c8u529fu80fdn* u8bb8u591au5c0fu7ec6u8282",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "TobyoTenma": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.4.0"
    "platforms": {
        "ios": "8.0"
    "source_files": "TTAImagePickerController/Classes/**/*",
    "resource_bundles": {
        "TTAImagePickerController": [
    "frameworks": [
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This