Skip to content

Latest commit

 

History

History
executable file
·
78 lines (57 loc) · 2.14 KB

README.md

File metadata and controls

executable file
·
78 lines (57 loc) · 2.14 KB

MSActionSheet: Logo

CocoaPods MSActionSheet MSActionSheet Platform

Customized ActionSheet for taking photo from library / front / rear camera or custom buttons.

Now supporting iPad

MSActionSheet: screenshot

Installation

Manually

Drag and drop MSActionSheet.swift and Assets into your project

MSActionSheet: installation

Usage - long way

Creating new ActionSheet, When the user select the image, get selected Image:

MSActionSheet(viewController: self, sourceView: sender)
    .add(.library)
    .add(.rearCamera)
    .add(.frontCamera)
    .add(.cancel).show { (image) in
}

Usage - Short way

Creating new ActionSheet, when user finish picking get image

MSActionSheet(viewController: self, sourceView: sender).showFullActionSheet {
    sender.setImage($0, for: .normal)
}

Customizing

Set custom title, image, style :

.add(.frontCamera, title: "Take a Selfie", style: .destructive, image: #imageLiteral(resourceName: "my_image"))

Use the default image :

.add(.rearCamera, defaultImage: true)

Add custom buttons :

.addCustom(title: "Print", image: #imageLiteral(resourceName: "print_photo")) {
    // action when the user click on "Print button"
    print("Printing the photo")
}.addCustom(title: "Share", image: #imageLiteral(resourceName: "share_photo")) {
    // action when the user click on "Share button"
    print("Sharing the photo")
}

Set ActionSheet tint color

.setTint(color: .purple)

Privacy permissions

Please make sure to enable in Info.plist

Privacy - Photo Library Usage Description Privacy - Camera Usage Description MSActionSheet: Customized ActionSheet for taking photo from library / front / rear camera

License

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