forked from ptshih/PSCollectionView
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 112ab40
Showing
4 changed files
with
464 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// PSCollectionView.h | ||
// PSKit | ||
// | ||
// Created by Peter Shih on 11/24/11. | ||
// Copyright (c) 2011 Peter Shih. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@protocol PSCollectionViewDelegate, PSCollectionViewDataSource; | ||
|
||
@interface PSCollectionView : UIScrollView <NSCoding, UIGestureRecognizerDelegate> | ||
|
||
@property (nonatomic, retain) UIView *headerView; | ||
@property (nonatomic, retain) UIView *footerView; | ||
@property (nonatomic, retain) UIView *emptyView; | ||
@property (nonatomic, retain) NSMutableSet *reuseableViews; | ||
@property (nonatomic, retain) NSMutableDictionary *visibleViews; | ||
@property (nonatomic, retain) NSMutableArray *viewKeysToRemove; | ||
@property (nonatomic, retain) NSMutableDictionary *indexToRectMap; | ||
@property (nonatomic, assign) NSInteger numColsLandscape; | ||
@property (nonatomic, assign) NSInteger numColsPortrait; | ||
@property (nonatomic, assign) CGFloat colWidth; | ||
@property (nonatomic, assign) id <PSCollectionViewDelegate> collectionViewDelegate; | ||
@property (nonatomic, assign) id <PSCollectionViewDataSource> collectionViewDataSource; | ||
|
||
#pragma mark - DataSource | ||
- (void)reloadViews; | ||
|
||
#pragma mark - Reusing Views | ||
- (UIView *)dequeueReusableView; | ||
- (void)enqueueReusableView:(UIView *)view; | ||
- (void)removeAndAddCellsIfNecessary; | ||
|
||
@end | ||
|
||
|
||
@protocol PSCollectionViewDelegate <NSObject> | ||
@optional | ||
- (void)collectionView:(PSCollectionView *)collectionView didSelectView:(UIView *)view atIndex:(NSInteger)index; | ||
|
||
@end | ||
|
||
@protocol PSCollectionViewDataSource <NSObject> | ||
|
||
@required | ||
- (NSInteger)numberOfViewsInCollectionView:(PSCollectionView *)collectionView; | ||
- (UIView *)collectionView:(PSCollectionView *)collectionView viewAtIndex:(NSInteger)index; | ||
- (CGFloat)heightForViewAtIndex:(NSInteger)index; | ||
|
||
@end |
Oops, something went wrong.