RLPageControl
RLPageControl copied to clipboard
Current page limiting refactor
I moved the code where the current page is limited (was inline MIN/MAX functions) to a new method used by the property setter, because:
- It was possible for clients of the page control to set invalid values
- A math error with unsigned ints was causing current page to be set to a large number instead of zero
Previously when currentPage was zero, the code
[self setCurrentPage:MAX(self.currentPage - 1, 0)];
would result in the currentPage being set to (NSUInteger)-1, which is large.