// // MMCPSScrollView.h // MMCPSScrollView // // Created by Martin on 02-04-13. // Copyright (c) 2013 Martin Metselaar. All rights reserved. // #import typedef enum { MMCPSScrollHorizontal, MMCPSScrollVertical } MMCPSScrollType; @class MMCPSScrollView; @protocol MMCPSScrollViewDelegate - (void) scrollView:(MMCPSScrollView *) scrollView willScrollToPage:(NSUInteger) pageIndex; - (void) scrollView:(MMCPSScrollView *) scrollView didScrollToPage:(NSUInteger) pageIndex; @end @interface MMCPSScrollView : UIScrollView { MMCPSScrollType _type; CGPoint _endScrollingPoint; CGPoint _startDraggingPoint; NSInteger _pageToScrollToo; CGRect _bottomComponent; } // The height of one segment @property (nonatomic) NSInteger segmentSize; // The number of segments that represent one page @property (nonatomic) NSInteger pageSize; @property (nonatomic) MMCPSScrollType type; // Set to true if you want it to fit the screen. // Set to false if you want to have white space. @property (nonatomic, assign) BOOL enableFitScreen; // Time it takes to scroll to next page @property (nonatomic) CGFloat scrollingTime; @property (nonatomic) NSInteger currentPage; @property (nonatomic, assign) id MMCPSDelegate; - (id)initWithFrame:(CGRect)frame andType:(MMCPSScrollType) type; - (void) scrollToPage:(NSInteger) index; @end