Skip to content

Commit

Permalink
Finetunin' (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
BasThomas authored Jan 19, 2020
1 parent 4843b30 commit 68ac921
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
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

0 comments on commit 68ac921

Please sign in to comment.