Uh oh!
There was an error while loading. Please reload this page.
added support for UIPageControl - #148
Conversation
tcurdt
commented
Jul 24, 2016
Still need to add a test. But before I do please let me know if it's otherwise OK. |
| extension UIPageControl { | ||
| /// Wraps a label's `numberOfPages` value in a bindable property. | ||
| public var rex_numberOfPages: MutableProperty<Int> { |
RuiAAPeres
commented
Jul 24, 2016
@tcurdt Tests and it's good to go! |
| /// Wraps a page control's `currentPage` value in a bindable property. | ||
| public var rex_currentPage: MutableProperty<Int> { | ||
| return associatedProperty(self, key: ¤tPageKey, initial: { $0.currentPage }, setter: { $0.currentPage = $1 }) |
There was a problem hiding this comment.
I think we should use UIControl's rex_value for this purpose, that way we can keep this property up-to-date since we will process each UIControlEventValueChanged event triggered from any user interaction.
There was a problem hiding this comment.
While I am not objecting I am not sure I can follow the argument. What do you mean by "keep this property up-to-date"?
There was a problem hiding this comment.
It will keep currentPage and rex_currentPage in sync. Right now we can control UIPageControl's currentPage but if the user interacts with the page control changing to a certain page manually, triggering a UIControlEventValueChanged event, our bindable property will not be updated with the new index.
There was a problem hiding this comment.
@tcurdt can you please change it to:
publicvarrex_currentPage:MutableProperty<Int>{returnUIControl.rex_value(self, getter:{ $0.currentPage }, setter:{ $0.currentPage = $1 })}dmcrodrigues
commented
Jul 24, 2016
👍 |
dmcrodrigues
commented
Jul 24, 2016
@tcurdt please don't forget to add this new files in each target, iOS and tvOS. |
tcurdt
commented
Jul 24, 2016
The tests are passing now. I might not have enough insights into the |
No description provided.