Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added property delay to SplashScreen, if one actually want to show th…

…e SplashScreen for a longer time (don't do this :) )
  • Loading branch information...
commit fd45bb2191d761224223a7fbb0d84fd40a814a38 1 parent e5b54e7
Matthias Tretter myell0w authored
Showing with 7 additions and 5 deletions.
  1. +3 −0  MTSplashScreen.h
  2. +4 −5 MTSplashScreen.m
3  MTSplashScreen.h
View
@@ -17,6 +17,7 @@
@interface MTSplashScreen : UIViewController {
UIImage *splashImage_;
BOOL showsStatusBarOnDismissal_;
+ NSTimeInterval delay_;
id<MTSplashScreenDelegate> delegate_;
}
@@ -24,6 +25,8 @@
@property (nonatomic, retain) UIImage *splashImage;
@property (nonatomic, assign) BOOL showsStatusBarOnDismissal;
@property (nonatomic, assign) id<MTSplashScreenDelegate> delegate;
+@property (nonatomic, assign) NSTimeInterval delay;
+
+ (MTSplashScreen *)splashScreen;
9 MTSplashScreen.m
View
@@ -19,6 +19,7 @@ @implementation MTSplashScreen
@synthesize splashImage = splashImage_;
@synthesize showsStatusBarOnDismissal = showsStatusBarOnDismissal_;
@synthesize delegate = delegate_;
+@synthesize delay = delay_;
////////////////////////////////////////////////////////////////////////
#pragma mark -
@@ -33,10 +34,8 @@ + (MTSplashScreen *)splashScreen {
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
- if (isIPad()) {
- showsStatusBarOnDismissal_ = YES;
- self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
- }
+ self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
+ delay_ = 0.;
}
return self;
@@ -74,7 +73,7 @@ - (void)viewDidAppear:(BOOL)animated {
[self.delegate splashScreenDidAppear:self];
}
- [self hide];
+ [self performSelector:@selector(hide) withObject:nil afterDelay:self.delay];
}
- (void)viewWillDisappear:(BOOL)animated {
Please sign in to comment.
Something went wrong with that request. Please try again.