https://github.com/meniny/dialog
⚠️A Dialog View for iOS
https://github.com/meniny/dialog
Last synced: about 1 year ago
JSON representation
⚠️A Dialog View for iOS
- Host: GitHub
- URL: https://github.com/meniny/dialog
- Owner: Meniny
- License: mit
- Created: 2017-07-17T05:27:11.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-17T15:46:01.000Z (almost 9 years ago)
- Last Synced: 2025-04-08T10:41:16.819Z (about 1 year ago)
- Language: Swift
- Homepage:
- Size: 6.38 MB
- Stars: 11
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## What's this?
`Dialog` is a delightful dialog view for iOS written in Swift.
## Requirements
* iOS 9.0+
* Xcode 8 with Swift 3
## Preview


## Installation
#### CocoaPods
```ruby
pod 'Dialog'
```
## Contribution
You are welcome to fork and submit pull requests.
## License
`Dialog` is open-sourced software, licensed under the `MIT` license.
## Samples
#### Minimum Usage
```swift
let d = Dialog.alert(title: "Greetings", message: "Hi there! How's going?")
d.addAction(title: "Done", handler: { (dialog) -> (Void) in
dialog.dismiss()
})
d.show(in: self)
```
#### Image & Actions
```swift
let d = Dialog.alert(title: "Dialog", message: "Check out my avatar!", image: #imageLiteral(resourceName: "avatar"))
d.rightToolStyle = { (button) in
button.setImage(#imageLiteral(resourceName: "share"), for: .normal)
button.tintColor = .lightGray
return true
}
d.rightToolAction = { (button) in
d.addAction(title: "Done", handler: { (dialog) -> (Void) in
dialog.dismiss()
})
}
d.addAction(title: "Add a Button", handler: { (dialog) -> (Void) in
dialog.addAction(title: "Remove the Last Button", handler: { (dia) -> (Void) in
dialog.removeAction(at: dia.actions.count - 1)
})
})
d.show(in: self)
```
#### Loading
```swift
let d = Dialog.loading(title: "Logging in", message: "Please wait...", image: #imageLiteral(resourceName: "avatar"))
d.show(in: self)
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 3, execute: {
d.dismiss()
})
```