Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/egzonarifi/eaalertview

iOS 11 Style Alerts
https://github.com/egzonarifi/eaalertview

alert datepicker picker swift4

Last synced: 3 months ago
JSON representation

iOS 11 Style Alerts

Awesome Lists containing this project

README

        

# EAAlertView
iOS Modern Style Alerts


Swift 4.0
Platform: iOS
XCode 9+
iOS 11
Licence MIT

# Alerts & Pickers

Alerts with TextField, TextView, DatePicker, PickerView

## Usage




- New Alert

```swift
let alert = EAAlertView(appearance: appearance)
// or
let alert = EAAlertView()
```

- Set and styling message

```swift
let appearance = EAAlertView.EAAppearance(
kTextFieldHeight: 60,
kButtonHeight: 60,
showCloseButton: false,
shouldAutoDismiss: false
)
```
- Add button with image

```swift
alert.addAction(image: image, title: "Title", color: .black, style: .default) { action in
// completion handler
}
```

* Show Alert

```swift
// show alert
_ = alert.show("Title", subTitle: "subtitle")
```

## Date picker



```swift
let picker = UIDatePicker(frame: CGRect(x: 0, y: 0, width: self.view.frame.width*0.8, height: 200))
picker.datePickerMode = UIDatePickerMode.date

let appearance = EAAlertView.EAAppearance(kButtonHeight: 60, showCloseButton: false, shouldAutoDismiss: false)
let alert = EAAlertView(appearance: appearance)
alert.customSubview = picker

_ = alert.addButton(backgroundImage: image), "Select") {
alert.hideView()
}
_ = alert.show("Birthdate", subTitle: " ")
```

## Text View



```swift
let appearance = EAAlertView.EAAppearance(kTextViewdHeight: self.view.frame.height*0.6, kButtonHeight: 60, showCloseButton: false, shouldAutoDismiss: false)
let alert = EAAlertView(appearance: appearance)

let textView = alert.addTextView()
textView.text = "text"

_ = alert.addButton(backgroundImage: image, "Accept") {
alert.hideView()
}
_ = alert.show("Terms", subTitle: "")
```

## Installing

#### Cocoapods

`pod 'EAAlertView'`

## Requirements

* Swift 4
* iOS 11 or higher

## Authors

* **Egzon Arifi** - [egzonarifi](https://github.com/egzonarifi)

## Communication

* If you **found a bug**, open an issue.
* If you **have a feature request**, open an issue.
* If you **want to contribute**, submit a pull request.

## License

This project is licensed under the MIT License.