https://github.com/liulietlee/lldialog
Material design dialog for iOS written in Swift.
https://github.com/liulietlee/lldialog
dialog ios material swift
Last synced: 2 months ago
JSON representation
Material design dialog for iOS written in Swift.
- Host: GitHub
- URL: https://github.com/liulietlee/lldialog
- Owner: LiulietLee
- License: mit
- Created: 2016-02-03T11:33:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-26T10:54:27.000Z (about 5 years ago)
- Last Synced: 2025-03-24T01:14:06.598Z (3 months ago)
- Topics: dialog, ios, material, swift
- Language: Swift
- Homepage:
- Size: 119 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# LLDialog
Material design dialog for iOS written in Swift.
## Installation
```
pod 'LLDialog', :git => 'https://github.com/LiulietLee/LLDialog.git'
```or just move [Source/LLDialog.swift](Source/LLDialog.swift) to your project.
## Usage
You can see a simple example by downloading this project.### Construct with Builder
```swift
LLDialog()
// Set title. (Optional, but recommended)
.set(title: "Use Google's location service?")// Set message. (Optional, but recommended)
.set(message: "Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.")// Set the buttons.
.setPositiveButton(withTitle: "AGREE", target: self, action: #selector(<#tappedPositiveButton#>))
.setNegativeButton(withTitle: "DISAGREE", target: self, action: #selector(<#tappedNegativeButton#>))// At last, show the dialog.
.show()
// Or, especially if targeting extensions, show in a parent view.
.show(in: <#T##parent UIView##UIView#>)
```### Or Convenience Initialzier
```swift
LLDialog(
title: "Unapplied method reference",
message: "It produces better indentation. Maybe not after SE-0042.",
positiveButton: .init(
title: "", // Title for positive button is required. Blank is the same as "OK".
onTouchUpInside: (target: self,
action: #selector(<#tappedPositiveButton#>))),
negativeButton: .init(
title: "What?",
onTouchUpInside: (target: self,
action: #selector(<#tappedNegativeButton#>)))
).show()
```## TO DO
- [ ] The animation after tapping the button.