Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finetunin' #17

Merged
merged 1 commit into from
Jan 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Next

## 3.2.0
- Added support to display a checkmark with `isChecked`
- Added support to display a checkmark with `isChecked`.

## 3.1.0

Expand Down
4 changes: 3 additions & 1 deletion ImageAlertAction/Classes/UIAlertAction+Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ extension UIAlertAction {
/// may be used with [UIAlertAction.Style.cancel](https://developer.apple.com/documentation/uikit/uialertaction/style/cancel).
/// - parameter image: An image to display on the left side of the button.
/// Use this to visually convey the action's purpose.
/// - parameter isChecked: A boolean that will be used to determine if a check mark should be displayed on the right side of the title
/// - parameter isChecked: A boolean that will be used to determine if a
/// check mark should be displayed on the right side of the title.
/// - parameter style: Additional styling information to apply to the button.
/// Use the style information to convey the type of action that is performed by the button.
/// For a list of possible values, see the constants in
Expand All @@ -50,5 +51,6 @@ extension UIAlertAction {
/// The image of the action's button.
public var image: UIImage? { value(forKey: imageKey) as? UIImage }

/// A Bool indicating if the action is checked or not.
public var isChecked: Bool { value(forKey: isCheckedKey) as? Bool ?? false }
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ settings.image // returns an optional UIImage

#### Adding a checkmark

You can also show a check mark on actions via `isChecked`
You can also show a check mark on actions via `isChecked`.

```swift
let settings = UIAlertAction(
Expand Down