123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- #import "PSTCollectionViewLayout.h"
- #import "PSTCollectionViewFlowLayout.h"
- #import "PSTCollectionViewCell.h"
- #import "PSTCollectionViewController.h"
- #import "PSTCollectionViewUpdateItem.h"
- @class PSTCollectionViewController;
- typedef NS_OPTIONS(NSUInteger, PSTCollectionViewScrollPosition) {
- PSTCollectionViewScrollPositionNone = 0,
-
-
- PSTCollectionViewScrollPositionTop = 1 << 0,
- PSTCollectionViewScrollPositionCenteredVertically = 1 << 1,
- PSTCollectionViewScrollPositionBottom = 1 << 2,
-
- PSTCollectionViewScrollPositionLeft = 1 << 3,
- PSTCollectionViewScrollPositionCenteredHorizontally = 1 << 4,
- PSTCollectionViewScrollPositionRight = 1 << 5
- };
- typedef NS_ENUM(NSUInteger, PSTCollectionElementCategory) {
- PSTCollectionElementCategoryCell,
- PSTCollectionElementCategorySupplementaryView,
- PSTCollectionElementCategoryDecorationView
- };
- @interface PSTCollectionView : UIScrollView
- - (id)initWithFrame:(CGRect)frame collectionViewLayout:(PSTCollectionViewLayout *)layout;
- @property (nonatomic, strong) PSTCollectionViewLayout *collectionViewLayout;
- @property (nonatomic, assign) IBOutlet id<PSTCollectionViewDelegate> delegate;
- @property (nonatomic, assign) IBOutlet id<PSTCollectionViewDataSource> dataSource;
- @property (nonatomic, strong) UIView *backgroundView;
- - (void)registerClass:(Class)cellClass forCellWithReuseIdentifier:(NSString *)identifier;
- - (void)registerClass:(Class)viewClass forSupplementaryViewOfKind:(NSString *)elementKind withReuseIdentifier:(NSString *)identifier;
- - (void)registerNib:(UINib *)nib forCellWithReuseIdentifier:(NSString *)identifier;
- - (void)registerNib:(UINib *)nib forSupplementaryViewOfKind:(NSString *)kind withReuseIdentifier:(NSString *)identifier;
- - (id)dequeueReusableCellWithReuseIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath;
- - (id)dequeueReusableSupplementaryViewOfKind:(NSString *)elementKind withReuseIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath;
- @property (nonatomic) BOOL allowsSelection;
- @property (nonatomic) BOOL allowsMultipleSelection;
- - (NSArray *)indexPathsForSelectedItems;
- - (void)selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(PSTCollectionViewScrollPosition)scrollPosition;
- - (void)deselectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated;
- - (void)reloadData;
- - (void)setCollectionViewLayout:(PSTCollectionViewLayout *)layout animated:(BOOL)animated;
- - (NSInteger)numberOfSections;
- - (NSInteger)numberOfItemsInSection:(NSInteger)section;
- - (PSTCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath;
- - (PSTCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
- - (NSIndexPath *)indexPathForItemAtPoint:(CGPoint)point;
- - (NSIndexPath *)indexPathForCell:(PSTCollectionViewCell *)cell;
- - (PSTCollectionViewCell *)cellForItemAtIndexPath:(NSIndexPath *)indexPath;
- - (NSArray *)visibleCells;
- - (NSArray *)indexPathsForVisibleItems;
- - (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(PSTCollectionViewScrollPosition)scrollPosition animated:(BOOL)animated;
- - (void)insertSections:(NSIndexSet *)sections;
- - (void)deleteSections:(NSIndexSet *)sections;
- - (void)reloadSections:(NSIndexSet *)sections;
- - (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection;
- - (void)insertItemsAtIndexPaths:(NSArray *)indexPaths;
- - (void)deleteItemsAtIndexPaths:(NSArray *)indexPaths;
- - (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
- - (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath;
- - (void)performBatchUpdates:(void (^)(void))updates completion:(void (^)(BOOL finished))completion;
- @end
- #define PSUICollectionView PSUICollectionView_
- #define PSUICollectionViewCell PSUICollectionViewCell_
- #define PSUICollectionReusableView PSUICollectionReusableView_
- #define PSUICollectionViewDelegate PSTCollectionViewDelegate
- #define PSUICollectionViewDataSource PSTCollectionViewDataSource
- #define PSUICollectionViewLayout PSUICollectionViewLayout_
- #define PSUICollectionViewFlowLayout PSUICollectionViewFlowLayout_
- #define PSUICollectionViewDelegateFlowLayout PSTCollectionViewDelegateFlowLayout
- #define PSUICollectionViewLayoutAttributes PSUICollectionViewLayoutAttributes_
- #define PSUICollectionViewController PSUICollectionViewController_
- @interface PSUICollectionView_ : PSTCollectionView @end
- @interface PSUICollectionViewCell_ : PSTCollectionViewCell @end
- @interface PSUICollectionReusableView_ : PSTCollectionReusableView @end
- @interface PSUICollectionViewLayout_ : PSTCollectionViewLayout @end
- @interface PSUICollectionViewFlowLayout_ : PSTCollectionViewFlowLayout @end
- @protocol PSUICollectionViewDelegateFlowLayout_ <PSTCollectionViewDelegateFlowLayout> @end
- @interface PSUICollectionViewLayoutAttributes_ : PSTCollectionViewLayoutAttributes @end
- @interface PSUICollectionViewController_ : PSTCollectionViewController <PSUICollectionViewDelegate, PSUICollectionViewDataSource> @end
|