Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Commit

Permalink
Adds introWillFinish delegate method
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeSc committed Jul 18, 2016
1 parent cf578e0 commit da706d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions EAIntroView/EAIntroView.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ typedef NS_ENUM(NSUInteger, EAViewAlignment) {

@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;
Expand Down
10 changes: 9 additions & 1 deletion EAIntroView/EAIntroView.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ - (void)checkIndexForScrollView:(EARestrictedScrollView *)scrollView {
//if run here, it means you can't call _pages[self.currentPageIndex],
//to be safe, set to the biggest index
_currentPageIndex = _pages.count - 1;


if ([self.delegate respondsToSelector:@selector(introWillFinish:wasSkipped:)]) {
[self.delegate introWillFinish:self wasSkipped:self.skipped];
}

[self finishIntroductionAndRemoveSelf];
}
}
Expand Down Expand Up @@ -988,6 +992,10 @@ - (void)showInView:(UIView *)view animateDuration:(CGFloat)duration withInitialP
}

- (void)hideWithFadeOutDuration:(CGFloat)duration {
if ([self.delegate respondsToSelector:@selector(introWillFinish:wasSkipped:)]) {
[self.delegate introWillFinish:self wasSkipped:self.skipped];
}

[UIView animateWithDuration:duration animations:^{
self.alpha = 0;
} completion:^(BOOL finished){
Expand Down

0 comments on commit da706d1

Please sign in to comment.