-
Notifications
You must be signed in to change notification settings - Fork 0
/
MFPageFlowView.h
55 lines (39 loc) · 1.67 KB
/
MFPageFlowView.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
51
52
53
54
//
// MFPageFlowView
// Mentally Friendly
//
// Created by Kyle Fuller on 24/09/2012.
// Copyright (c) 2012-2013 Mentally Friendly. All rights reserved.
//
#import <UIKit/UIKit.h>
@class MFPageFlowView;
@protocol MFPageFlowViewDataSource <NSObject>
/** Asks the data source for the amount of views to display in the flow view
* @param flowView The page flow view requesting this information
* @return The number of views in the page flow view
*/
- (NSUInteger)numberOfPagesInFlowView:(MFPageFlowView*)flowView;
/** Asks the data source for the view to display in the flow view for an index
* @param flowView The page flow view requesting this information
* @return An object inheriting from UIView that the page flow view will use for this index. This must not be nil.
*/
- (UIView*)pageFlowView:(MFPageFlowView*)flowView
viewForPageAtIndex:(NSUInteger)index;
@end
typedef NS_ENUM(NSUInteger, MFPageFlowViewLayoutOrientation) {
MFPageFlowViewLayoutOrientationHorizontal,
MFPageFlowViewLayoutOrientationVertical,
};
/** MFPageFlowView is a view which allows you to have a set of pages that you can swipe across.
This class can be used to make a view which can swipe over images.
*/
@interface MFPageFlowView : UIScrollView
@property (nonatomic, assign) MFPageFlowViewLayoutOrientation layoutOrientation;
@property (nonatomic, assign) NSUInteger currentPage;
@property (nonatomic, weak) IBOutlet id<MFPageFlowViewDataSource> dataSource;
/** Once set, MFPageFlowView will update the page control */
@property (nonatomic, weak) IBOutlet UIPageControl *pageControl;
- (void)reloadData;
- (void)setCurrentPage:(NSUInteger)currentPage
animated:(BOOL)animated;
@end