Skip to content

Commit

Permalink
Version 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alekseyn committed Jan 7, 2016
1 parent 1410eb1 commit 7699d23
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Classes/EasyTableView.h
Expand Up @@ -58,8 +58,8 @@ typedef NS_ENUM(NSUInteger, EasyTableViewOrientation){
@property (nonatomic, assign) CGPoint contentOffset;
@property (nonatomic, assign) NSUInteger numberOfCells;

- (id)initWithFrame:(CGRect)frame ofWidth:(CGFloat)cellWidth;
- (id)initWithFrame:(CGRect)frame ofHeight:(CGFloat)cellHeight;
- (instancetype)initWithFrame:(CGRect)frame ofWidth:(CGFloat)cellWidth;
- (instancetype)initWithFrame:(CGRect)frame ofHeight:(CGFloat)cellHeight;
- (void)setContentOffset:(CGPoint)offset animated:(BOOL)animated;

@end
10 changes: 5 additions & 5 deletions Classes/EasyTableViewController.m
Expand Up @@ -179,6 +179,11 @@ - (void)easyTableView:(EasyTableView *)tableView didSelectRowAtIndexPath:(NSInde
self.bigLabel.text = label.text;
}

// Delivers the number of cells in each section, this must be implemented if numberOfSectionsInEasyTableView is implemented
- (NSInteger)easyTableView:(EasyTableView *)easyTableView numberOfRowsInSection:(NSInteger)section {
return NUM_OF_CELLS;
}

#pragma mark - Optional EasyTableView delegate methods for section headers and footers

#ifdef SHOW_MULTIPLE_SECTIONS
Expand All @@ -188,11 +193,6 @@ - (NSUInteger)numberOfSectionsInEasyTableView:(EasyTableView*)easyTableView {
return NUM_OF_SECTIONS;
}

// Delivers the number of cells in each section, this must be implemented if numberOfSectionsInEasyTableView is implemented
- (NSInteger)easyTableView:(EasyTableView *)easyTableView numberOfRowsInSection:(NSInteger)section {
return NUM_OF_CELLS;
}

// The height of the header section view MUST be the same as your HORIZONTAL_TABLEVIEW_HEIGHT (horizontal EasyTableView only)
- (UIView *)easyTableView:(EasyTableView*)easyTableView viewForHeaderInSection:(NSInteger)section {
UILabel *label = [[UILabel alloc] init];
Expand Down
3 changes: 1 addition & 2 deletions Classes/FlipsideViewController.m
Expand Up @@ -102,8 +102,7 @@ - (void)imageTitles:(NSArray *)titles {
[self setupEasyTableView];
}

- (NSInteger)easyTableView:(EasyTableView *)easyTableView numberOfRowsInSection:(NSInteger)section
{
- (NSInteger)easyTableView:(EasyTableView *)easyTableView numberOfRowsInSection:(NSInteger)section {
return self.imageStore.titles.count;
}

Expand Down
4 changes: 2 additions & 2 deletions EasyTableView.podspec
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.name = "EasyTableView"
s.version = "2.0"
s.version = 2.0.1
s.summary = "Horizontal and vertical scrolling table views for iOS."
s.homepage = "https://github.com/alekseyn/EasyTableView"
s.license = { :type => "MIT" }
s.author = { "Aleksey Novicov" => "aleksey@yodelcode.com" }
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/alekseyn/EasyTableView.git", :tag => "2.0" }
s.source = { :git => "https://github.com/alekseyn/EasyTableView.git", :tag => 2.0.1 }
s.source_files = "Classes/EasyTableView.{h,m}"
s.requires_arc = true
end
14 changes: 7 additions & 7 deletions README
Expand Up @@ -58,20 +58,20 @@ USAGE

To understand how to use EasyTableView, study the code in EasyTableViewController.m or FlipsideViewController.m. To create a new EasyTableView object, look at the methods (void)setupHorizontalView and (void)setupVerticalView. As seen in the source code, you initialize a vertical scrolling table view with:

- (id)initWithFrame:(CGRect)frame numberOfRows:(NSUInteger)numCells ofHeight:(CGFloat)cellHeight;
- (id)initWithFrame:(CGRect)frame ofHeight:(CGFloat)cellHeight;

To initialize a horizontal scrolling table view use:

- (id)initWithFrame:(CGRect)frame numberOfColumns:(NSUInteger)numCells ofWidth:(CGFloat)cellWidth;
- (id)initWithFrame:(CGRect)frame ofWidth:(CGFloat)cellWidth;

The numberOfRows or numberOfColumns parameters in the above two methods are only used if you are implementing an EasyTableView with one section. Otherwise, those parameters are ignored and can be set to anything. If you plan to setup an EasyTableView with multiple sections, you must implement the following two delegate methods:
There are only two delegate methods that must always be implemented as part of the EasyTableViewDelegate protocol:

- (NSUInteger)numberOfSectionsInEasyTableView:(EasyTableView*)easyTableView;
- (NSUInteger)numberOfCellsForEasyTableView:(EasyTableView *)view inSection:(NSInteger)section;
- (NSInteger)easyTableView:(EasyTableView *)easyTableView numberOfRowsInSection:(NSInteger)section {
- (UITableViewCell *)easyTableView:(EasyTableView *)easyTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

There is only one delegate method for the EasyTableViewDelegate protocol that must alway be implemented:
If you plan to setup an EasyTableView with multiple sections, you must implement the following delegate method:

- (UITableViewCell *)easyTableView:(EasyTableView *)easyTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- (NSUInteger)numberOfSectionsInEasyTableView:(EasyTableView*)easyTableView;

That's all there is to it. It is very easy to use. And yes, that is a picture of my tent!

Expand Down

0 comments on commit 7699d23

Please sign in to comment.