@@ -201,13 +201,17 @@
#pragma mark - Private
- (void)updateIndicator {
-
- NSUInteger index = 0;
- if (self.currentIndex < self.offset) {
- index = (unsigned long)self.currentIndex + 1 + self.offset;
- } else {
- index = (unsigned long)self.currentIndex + 1 - self.offset;
- }
+
+ /**
+ x
+ 0 1 2 3 4 5 6 7 8 9
+ 4 5 6 7 8 9 0 1 2 3
+ */
+ NSUInteger index = (self.currentIndex + self.offset) % self.photos.count + 1;
NSString *offset = [NSString stringWithFormat:@"%lu / %lu",index,(unsigned long)self.photos.count];
self.indicator.text = offset;
}