Latest 0.0.9
Homepage https://github.com/larcus94/ImagePickerSheetController
License MIT
Platforms ios 8.0, requires ARC
Frameworks Photos
Authors

ImagePickerSheetController

Twitter: @larcus94
License
Carthage compatible

About

ImagePickerSheetController is a component that replicates the custom photo action sheet in iMessage. It’s very similar to UIAlertController which makes its usage simple and concise.

Screenshot

Usage

ImagePickerSheetController is similar to UIAlertController in its usage.

Example

let controller = ImagePickerSheetController(mediaType: .ImageAndVideo)
controller.addAction(ImagePickerAction(title: NSLocalizedString("Take Photo Or Video", comment: "Action Title"), secondaryTitle: NSLocalizedString("Add comment", comment: "Action Title"), handler: { _ in
    presentImagePickerController(.Camera)
}, secondaryHandler: { _, numberOfPhotos in
    println("Comment (numberOfPhotos) photos")
}))
controller.addAction(ImagePickerAction(title: NSLocalizedString("Photo Library", comment: "Action Title"), secondaryTitle: { NSString.localizedStringWithFormat(NSLocalizedString("ImagePickerSheet.button1.Send %lu Photo", comment: "Action Title"), $0) as String}, handler: { _ in
    presentImagePickerController(.PhotoLibrary)
}, secondaryHandler: { _, numberOfPhotos in
    println("Send (controller.selectedImageAssets)")
}))
controller.addAction(ImagePickerAction(title: NSLocalizedString("Cancel", comment: "Action Title"), style: .Cancel, handler: { _ in
    println("Cancelled")
}))

presentViewController(controller, animated: true, completion: nil)

It’s recommended to use stringsdict to easily translate plural forms in any language.

Installation

CocoaPods

pod "ImagePickerSheetController", "~> 0.9.1"

Carthage

github "larcus94/ImagePickerSheetController" ~> 0.9.1

Requirements

ImagePickerSheetController is written in Swift and links against Photos.framework. It therefore requires iOS 8 or later.

Author

I’m Laurin Brandner, I’m on Twitter.

License

ImagePickerSheetController is licensed under the MIT License.

Latest podspec

{
    "name": "ImagePickerSheet",
    "version": "0.0.9",
    "summary": "A duplicate of that shiny new custom action sheet seen in iOS8's iMessage",
    "description": "                   ImagePickerSheet is a duplicate of that shiny new custom action sheet seen in iOS8's iMessage that Apple didn't make part of UIKit. It's the first project I've written in Swift. It works well but I might have coded something the Objective-C kind of way. Don't hesitate to open an issue or pull request if you spotted something. And no, ImagePickerSheet does not have the glitches Apple's image picker has :)n",
    "homepage": "https://github.com/larcus94/ImagePickerSheetController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Laurin Brandner": "[email protected]"
    },
    "social_media_url": "http://twitter.com/larcus94",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/larcus94/ImagePickerSheetController.git",
        "tag": "0.0.9"
    },
    "source_files": "ImagePickerSheetController/ImagePickerSheetController/*.swift",
    "resource_bundles": {
        "Images": [
            "ImagePickerSheetController/ImagePickerSheetController/Images.xcassets"
        ]
    },
    "frameworks": "Photos",
    "requires_arc": true,
    "deprecated_in_favor_of": "ImagePickerSheetController"
}

Pin It on Pinterest

Share This