Latest 0.1.1
Homepage https://github.com/Benny-iPhone/BDCustomAlertController
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

What does it do?

UIAlertAction

  • Display an UIImage within UIAlertAction using actionWithTitle:image:style:handler:

  • Display Image and Text using your prefered layout (leader or trailing) by invoking actionWithCustomContent:handler:

UIAlertController

  • Computed Tint Color

  • Date Picker as Cotent View Controller

  • More Content Options will be added as you request

Example

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

Display an UIAlertAction with text and image

    func displayAlertActionWithImage(){

        let alert = UIAlertController(title: "yo!", message: "a message", preferredStyle: .alert)
        let action = UIAlertAction(title: "Your Text", image: UIImage(named: "your_image_name"), style: .default) { (_) in
            //some code to handle the action
        }
        alert.addAction(action)

        self.present(alert, animated: true, completion: nil)

    }
Display an UIAlertController with UIDatePicker
    func displayAlertWithDatePicker(){
        let alert = UIAlertController(title: "yo!", message: "select a date messsage", preferredStyle: .alert)
        alert.insertDatePicker { (datePicker) in
            //config date picker as you like here
        }

        alert.addAction(UIAlertAction(title: "Done", style: .default, handler: { (_) in
            guard let datePicker = alert.datePicker() else{
                return
            }

            print("selected date is (datePicker.date)")
        }))

        self.present(alert, animated: true, completion: nil)

    }

Installation

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

pod 'BDCustomAlertController'

Author

Benny Davidovitz

License

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

Latest podspec

{
    "name": "BDCustomAlertController",
    "version": "0.1.1",
    "summary": "Cusomizable UIAlertController and UIAlertAction for nice and easy display.",
    "description": "- UIAlertAction with image and custom content (image and text for now)n- UIAlertController with date picker",
    "homepage": "https://github.com/Benny-iPhone/BDCustomAlertController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Benny Davidovitz": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Benny-iPhone/BDCustomAlertController.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "BDCustomAlertController/Classes/**/*"
}

Pin It on Pinterest

Share This