123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #import <UIKit/UIKit.h>
- #import <EARestrictedScrollView/EARestrictedScrollView.h>
- #import "EAIntroPage.h"
- #define EA_EMPTY_PROPERTY 9999.f
- #define SKIP_BTN_DEFAULT_WIDTH 100.f
- #define SKIP_BTN_DEFAULT_HEIGHT 40.f
- #define PAGE_CTRL_DEFAULT_HEIGHT 36.f
- enum EAIntroViewTags {
- kTitleLabelTag = 1,
- kDescLabelTag,
- kTitleImageViewTag
- };
- typedef NS_ENUM(NSUInteger, EAViewAlignment) {
- EAViewAlignmentLeft,
- EAViewAlignmentCenter,
- EAViewAlignmentRight,
- };
- @class EAIntroView;
- @protocol EAIntroDelegate<NSObject>
- @optional
- - (void)introWillFinish:(EAIntroView *)introView wasSkipped:(BOOL)wasSkipped;
- - (void)introDidFinish:(EAIntroView *)introView wasSkipped:(BOOL)wasSkipped;
- - (void)intro:(EAIntroView *)introView pageAppeared:(EAIntroPage *)page withIndex:(NSUInteger)pageIndex;
- - (void)intro:(EAIntroView *)introView pageStartScrolling:(EAIntroPage *)page withIndex:(NSUInteger)pageIndex;
- - (void)intro:(EAIntroView *)introView pageEndScrolling:(EAIntroPage *)page withIndex:(NSUInteger)pageIndex;
- - (void)intro:(EAIntroView *)introView didScrollWithOffset:(CGFloat)offset;
- @end
- @interface EAIntroView : UIView <UIScrollViewDelegate>
- @property (nonatomic, weak) id<EAIntroDelegate> delegate;
- @property (nonatomic, assign) BOOL swipeToExit;
- @property (nonatomic, assign) BOOL tapToNext;
- @property (nonatomic, assign) BOOL hideOffscreenPages;
- @property (nonatomic, assign) BOOL easeOutCrossDisolves;
- @property (nonatomic, assign) BOOL useMotionEffects;
- @property (nonatomic, assign) CGFloat motionEffectsRelativeValue;
- @property (nonatomic, strong) UIView *titleView;
- @property (nonatomic, assign) CGFloat titleViewY;
- @property (nonatomic, strong) UIImage *bgImage;
- @property (nonatomic, assign) UIViewContentMode bgViewContentMode;
- @property (nonatomic, strong) UIPageControl *pageControl;
- @property (nonatomic, assign) CGFloat pageControlY;
- @property (nonatomic, assign) NSUInteger currentPageIndex;
- @property (nonatomic, assign, readonly) NSUInteger visiblePageIndex;
- @property (nonatomic, strong) UIButton *skipButton;
- @property (nonatomic, assign) CGFloat skipButtonY;
- @property (nonatomic, assign) CGFloat skipButtonSideMargin;
- @property (nonatomic, assign) EAViewAlignment skipButtonAlignment;
- @property (nonatomic, assign) BOOL showSkipButtonOnlyOnLastPage;
- @property (nonatomic, assign) NSInteger limitPageIndex;
- @property (nonatomic, strong) EARestrictedScrollView *scrollView;
- @property (nonatomic, assign) BOOL scrollingEnabled;
- @property (nonatomic, strong) NSArray<EAIntroPage *> *pages;
- - (id)initWithFrame:(CGRect)frame andPages:(NSArray<EAIntroPage *> *)pagesArray;
- - (void)showFullscreen;
- - (void)showFullscreenWithAnimateDuration:(CGFloat)duration;
- - (void)showFullscreenWithAnimateDuration:(CGFloat)duration andInitialPageIndex:(NSUInteger)initialPageIndex;
- - (void)showInView:(UIView *)view;
- - (void)showInView:(UIView *)view animateDuration:(CGFloat)duration;
- - (void)showInView:(UIView *)view animateDuration:(CGFloat)duration withInitialPageIndex:(NSUInteger)initialPageIndex;
- - (void)hideWithFadeOutDuration:(CGFloat)duration;
- - (void)setCurrentPageIndex:(NSUInteger)currentPageIndex;
- - (void)setCurrentPageIndex:(NSUInteger)currentPageIndex animated:(BOOL)animated;
- - (void)scrollToPageForIndex:(NSUInteger)newPageIndex animated:(BOOL)animated;
- @end
|