Skip to content

Commit

Permalink
Using NSIntegers for my row and columns to avoid type issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
btate committed Aug 27, 2014
1 parent 7a1720b commit 07f4f1d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
5 changes: 1 addition & 4 deletions BTGridPager.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
#
Pod::Spec.new do |s|
s.name = "BTGridPager"
s.version = "0.1.7"
s.version = "0.1.8"
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
allows for unlimited number of views to be paged through both vertically and horizontally.
* Markdown format.
* Don't worry about the indent, we strip it!
DESC
s.homepage = "https://github.com/btate/BTGridPager"
s.license = 'MIT'
Expand Down
28 changes: 24 additions & 4 deletions BTGridPager/BTGridIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,30 @@

@interface BTGridIndex : NSObject<NSCopying>

@property (nonatomic) int row;
@property (nonatomic) int column;
/** The index row. */
@property (nonatomic) NSInteger row;

- (id) initWithRow: (int) row column: (int) column;
+ (BTGridIndex *) gridIndexWithRow: (int) row column: (int) column;
/** The index column. */
@property (nonatomic) NSInteger column;

/**
* Initializer with row column properties.
*
* @param row The index row
* @param column The index column
*
* @return The grid index
*/
- (id) initWithRow: (NSInteger) row column: (NSInteger) column;

/**
* Class method for creating a grid index.
*
* @param row The index row
* @param column The index column
*
* @return The grid index
*/
+ (BTGridIndex *) gridIndexWithRow: (NSInteger) row column: (NSInteger) column;

@end
21 changes: 19 additions & 2 deletions BTGridPager/BTGridIndex.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
@implementation BTGridIndex


- (id) initWithRow: (int) row column: (int) column{
/**
* Initializer with row column properties.
*
* @param row The index row
* @param column The index column
*
* @return The grid index
*/
- (id) initWithRow: (NSInteger) row column: (NSInteger) column{
self = [super init];

if (self) {
Expand All @@ -26,7 +34,16 @@ - (BOOL) isEqual:(BTGridIndex *)object{
return (self.row == object.row) && (self.column == object.column);
}

+ (BTGridIndex *) gridIndexWithRow: (int) row column: (int) column{

/**
* Class method for creating a grid index.
*
* @param row The index row
* @param column The index column
*
* @return The grid index
*/
+ (BTGridIndex *) gridIndexWithRow: (NSInteger) row column: (NSInteger) column{
return [[BTGridIndex alloc] initWithRow:row column:column];
}

Expand Down

0 comments on commit 07f4f1d

Please sign in to comment.