Skip to content

Commit

Permalink
Added a reload data method.
Browse files Browse the repository at this point in the history
  • Loading branch information
btate committed Aug 12, 2014
1 parent 19e65bb commit 724e961
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BTGridPager.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
Pod::Spec.new do |s|
s.name = "BTGridPager"
s.version = "0.1.3"
s.version = "0.1.5"
s.summary = "BTGridLayout is a subclass of UIScrollView that allows horizontal and vertical view pagin for iOS."
s.description = <<-DESC
BTGridLayout is a subclass of UIScrollView that allows horizontal and vertical view pagin for iOS. It
Expand Down
8 changes: 8 additions & 0 deletions BTGridPager/BTGridPager.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ typedef NSUInteger BTGridResetMode;
@property (nonatomic) BTGridResetMode gridResetMode;


/**
* Reloads the views.
*
* @param resetIndex Flag for whether to reset the current index when reloading.
*/
- (void) reloadData: (BOOL) resetIndex;


@end


Expand Down
16 changes: 16 additions & 0 deletions BTGridPager/BTGridPager.m
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,22 @@ - (BTGridIndex *) wrapIndex: (BTGridIndex *) index{

}

/**
* Reloads the views.
*
* @param resetIndex Flag for whether to reset the current index when reloading.
*/
- (void) reloadData: (BOOL) resetIndex{

if (resetIndex) {
_currentIndex.row = 0;
_currentIndex.column = 0;
}

[self loadViewsForCurrentIndex];

}

#pragma mark - Gestures

/**
Expand Down

0 comments on commit 724e961

Please sign in to comment.