Latest 3.6.0
Homepage https://github.com/davbeck/TNKImagePickerController
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit, Photos
Authors

CI Status
Carthage compatible
Version
License
Platform

A replacement for UIImagePickerController that can select multiple photos.

Screenshots

Usage

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


To present the picker, use something similar to the following:

TNKImagePickerController *picker = [[TNKImagePickerController alloc] init];
picker.delegate = self;

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:picker];
// while this is not stricktly necessary, not including this line will disable taking photos with the camera, pasting images, and selecting all assts in a collection
navigationController.toolbarHidden = NO;

// present the picker as a popover on iPad and landscape iPhone 6+ and a modal sheet on iPhone
navigationController.modalPresentationStyle = UIModalPresentationPopover;
navigationController.popoverPresentationController.sourceView = self.pickPhotosButton;
navigationController.popoverPresentationController.sourceRect = self.pickPhotosButton.bounds;

[self presentViewController:navigationController animated:YES completion:nil];

Your delegate should impliment the following methods in order to get the image assets:

#pragma mark - TNKImagePickerControllerDelegate

- (void)imagePickerController:(TNKImagePickerController *)picker
       didFinishPickingAssets:(NSSet *)assets {
    [[PHImageManager defaultManager] requestImagesForAssets:assets.allObjects targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeDefault options:nil resultHandler:^(NSDictionary *results, NSDictionary *infos) {
        NSArray *images = results.allValues;
    }];

    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)imagePickerControllerDidCancel:(TNKImagePickerController *)picker {
    [self dismissViewControllerAnimated:YES completion:nil];
}

Installation

Cocoapods

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

pod "TNKImagePickerController", "~> 0.2"

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate TNKImagePickerController into your Xcode project using Carthage, specify it in your Cartfile:

github "davbeck/TNKImagePickerController" ~> 0.2

Run carthage to build the framework and drag the built TNKImagePickerController.framework into your Xcode project.

Author

David Beck, [email protected]

Special thanks to The City for allowing me to open source this project.

License

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

Latest podspec

{
    "name": "TNKImagePickerController",
    "version": "3.6.0",
    "summary": "A replacement for UIImagePickerController that can select multiple photos.",
    "homepage": "https://github.com/davbeck/TNKImagePickerController",
    "screenshots": [
        "http://f.cl.ly/items/3c1h0N2X0N0y0a1U240P/IMG_0011.PNG",
        "http://f.cl.ly/items/0U473h2X2u211g3A1n0j/IMG_0012.PNG",
        "http://f.cl.ly/items/2n0A372v151R1P3p0g0o/IMG_0013.PNG"
    ],
    "license": "MIT",
    "authors": {
        "David Beck": "[email protected]"
    },
    "source": {
        "git": "https://github.com/davbeck/TNKImagePickerController.git",
        "tag": "3.6.0"
    },
    "social_media_url": "https://twitter.com/davbeck",
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "TNKImagePickerController/**/*.{h,m,swift}",
    "frameworks": [
        "UIKit",
        "Photos"
    ]
}

Pin It on Pinterest

Share This