-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add isEnabledPublisher to UIButton #37
base: main
Are you sure you want to change the base?
Add isEnabledPublisher to UIButton #37
Conversation
Codecov Report
@@ Coverage Diff @@
## main #37 +/- ##
==========================================
- Coverage 70.94% 70.56% -0.38%
==========================================
Files 28 28
Lines 561 564 +3
==========================================
Hits 398 398
- Misses 163 166 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @darko55555 !
Great addition, and the code looks good -
But, isEnabled
is on UIControl
, so sounds like there's an opportunity to have it for all UIControls.
Mind moving it to an appropriate extension and add a quick test for it in our test suite?
Thank you :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Quick note.
@@ -16,5 +16,10 @@ public extension UIButton { | |||
var tapPublisher: AnyPublisher<Void, Never> { | |||
controlEventPublisher(for: .touchUpInside) | |||
} | |||
|
|||
var isEnabledPublisher: AnyPublisher<Bool, Never> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make more sense for UIControl
as a whole
Added isEnabled publisher to UIButton
Example of usage, assign to isEnabledPublisher for form validation.