Chandu
Chandu

Reputation: 695

Adding UIActivityController on the splash screen

I took a default.png file and made it as my splash screen and i made it sleep for a few seconds to make it visible.

But i also want to add an UIActivityController to it. As i didn't take any ViewController.

How should i add it?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

_homeViewController = [[XTHomeViewController alloc]initWithNibName:kHOME_VIEW bundle:nil];
_navigate = [[UINavigationController alloc]initWithRootViewController:_homeViewController];

[self.window addSubview:_navigate.view];
[self.window makeKeyAndVisible];
[NSThread sleepForTimeInterval:0.75];
return YES;

This is All i Have.

Upvotes: 0

Views: 480

Answers (2)

Nilesh Kikani
Nilesh Kikani

Reputation: 2618

You can add Activityindicater like this

in DemoappeDelegate.h file

IBOutlet UiView *splashView;

in DemoappDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

   UIActivityIndicatorView *spinningWheel = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(145.0, 290.0, 25.0, 25.0)];
   [spinningWheel startAnimating];
   spinningWheel.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
   [splashView addSubview:spinningWheel];
   [spinningWheel release];
}

Upvotes: 1

Nikunj Jadav
Nikunj Jadav

Reputation: 3402

There is no way using UIActivityController but you can do it following way

First of all, you take

in .h file

IBOutlet UIProgressView * threadProgressView;

in .m file

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad 
    {

        threadProgressView.progress = 0.0;
        [self performSelectorOnMainThread:@selector(makeMyProgressBarMoving) withObject:nil waitUntilDone:NO]; 
        [super viewDidLoad];
    }

//For progress bar 

- (void)makeMyProgressBarMoving {

    float actual = [threadProgressView progress];
    if (actual < 1) {
        threadProgressView.progress = actual + 0.02;
        [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(makeMyProgressBarMoving) userInfo:nil repeats:NO];
    }

Upvotes: 1

Related Questions