forked from aceisScope/WaterflowView
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a new layout based on column height rather than rows
- Loading branch information
1 parent
bc2dcf9
commit 9bfd580
Showing
10 changed files
with
646 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.1 KB
(100%)
...roj/project.xcworkspace/xcuserdata/Appublisher.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// | ||
// WaterflowView.h | ||
// WaterFlowDisplay | ||
// | ||
// Created by B.H. Liu on 12-3-29. | ||
// Copyright (c) 2012年 Appublisher. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@class WaterflowView; | ||
|
||
////TableCell for WaterFlow | ||
@interface WaterFlowCell:UIView | ||
{ | ||
NSIndexPath *_indexPath; | ||
NSString *_reuseIdentifier; | ||
} | ||
|
||
@property (nonatomic, retain) NSIndexPath *indexPath; | ||
@property (nonatomic, retain) NSString *reuseIdentifier; | ||
|
||
- (id)initWithReuseIdentifier:(NSString *)reuseIdentifier; | ||
|
||
@end | ||
|
||
////DataSource and Delegate | ||
@protocol WaterflowViewDatasource <NSObject> | ||
@required | ||
- (NSInteger)numberOfColumnsInFlowView:(WaterflowView*)flowView; | ||
- (NSInteger)flowView:(WaterflowView *)flowView numberOfRowsInColumn:(NSInteger)column; | ||
- (WaterFlowCell *)flowView:(WaterflowView *)flowView cellForRowAtIndex:(NSInteger)index; | ||
- (WaterFlowCell *)flowView:(WaterflowView *)flowView cellForRowAtIndexPath:(NSIndexPath *)indexPath; | ||
@end | ||
|
||
@protocol WaterflowViewDelegate <NSObject> | ||
@required | ||
- (CGFloat)flowView:(WaterflowView *)flowView heightForRowAtIndexPath:(NSIndexPath *)indexPath; | ||
- (CGFloat)flowView:(WaterflowView *)flowView heightForCellAtIndex:(NSInteger)index; | ||
@optional | ||
- (void)flowView:(WaterflowView *)flowView didSelectRowAtIndexPath:(NSIndexPath *)indexPath; | ||
- (void)flowView:(WaterflowView *)flowView didSelectAtCell:(WaterFlowCell*)cell ForIndex:(int)index; | ||
- (void)flowView:(WaterflowView *)flowView willLoadData:(int)page; | ||
@end | ||
|
||
////Waterflow View | ||
@interface WaterflowView : UIScrollView<UIScrollViewDelegate> | ||
{ | ||
NSInteger numberOfColumns ; | ||
NSInteger currentPage; | ||
|
||
NSMutableArray *_cellHeight; | ||
NSMutableArray *_visibleCells; | ||
NSMutableDictionary *_reusedCells; | ||
|
||
id <WaterflowViewDelegate> _flowdelegate; | ||
id <WaterflowViewDatasource> _flowdatasource; | ||
} | ||
|
||
- (void)reloadData; | ||
|
||
- (id)dequeueReusableCellWithIdentifier:(NSString *)identifier; | ||
|
||
@property (nonatomic, retain) NSMutableArray *cellHeight; //array of cells height arrays, count = numberofcolumns, and elements in each single child array represents is a total height from this cell to the top | ||
@property (nonatomic, retain) NSMutableArray *cellIndex; //array of cells index arrays, count = numberofcolumns | ||
@property (nonatomic, retain) NSMutableArray *visibleCells; //array of visible cell arrays, count = numberofcolumns | ||
@property (nonatomic, retain) NSMutableDictionary *reusableCells; //key- identifier, value- array of cells | ||
@property (nonatomic, assign) id <WaterflowViewDelegate> flowdelegate; | ||
@property (nonatomic, assign) id <WaterflowViewDatasource> flowdatasource; | ||
|
||
@end |
Oops, something went wrong.