-
Notifications
You must be signed in to change notification settings - Fork 2
/
GridView.h
50 lines (36 loc) · 1.15 KB
/
GridView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// GridView.h
//
// Created by Jeremy Olmsted-Thompson on 3/5/12.
// Copyright (c) 2012 JOT. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef enum {
GridViewOrientationHorizontal,
GridViewOrientationVertical
} GridViewOrientation;
@class GridView;
@protocol GridViewCell
@optional
-(NSString*)reuseIdentifier;
@end
@protocol GridViewDataSource
-(UIView*)gridView:(GridView*)gridView viewForItemAtIndex:(NSInteger)index;
-(NSUInteger)numberOfTilesForGridView;
@optional
-(BOOL)gridViewShouldReload:(GridView*)gridView;
@end
@interface GridView : UIScrollView
@property (nonatomic) NSInteger rowCount;
@property (nonatomic) CGFloat horizontalSpacing;
@property (nonatomic) CGFloat verticalSpacing;
@property (nonatomic) CGFloat tileAspectRatio;
@property (nonatomic) GridViewOrientation orientation;
@property (nonatomic,readonly) CGSize tileSize;
@property (nonatomic,assign) IBOutlet NSObject<GridViewDataSource> *dataSource;
@property (nonatomic,readonly) BOOL loadingTiles;
@property (nonatomic,assign) NSUInteger bufferedScreenCount;
-(void)loadItems;
-(void)reloadData;
-(id)dequeueReusableTileWithIdentifier:(NSString*)identifier;
@end