Giter Club home page Giter Club logo

msactionsheet's Introduction

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.

msactionsheet's People

Contributors

maor360 avatar maors avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.