Göktuğ Aral
Göktuğ Aral

Reputation: 1409

How to add an UIView as a subview to Storyboard's view without any delay?

I'm not for sure if my title responds what I want to ask but let me explain;

I'm using storyboard, I have created "HomeViewController" and set it as custom class. Also, I want to create a view with programmatically and add this view to "HomeViewController" 's view.

enter image description here

These TabBar, GreenView and Logout Button are necessary. Because I added them via interface builder to see how quickly they appear on the screen and whenever I build and run my app, these components are load very quickly. They are not blinking or appear after a sec. They are stable!

Here is a simple code;

- (void)viewDidLoad {
[super viewDidLoad];

UIView *dummyView = [UIView new];
[dummyView setFrame:CGRectMake(0, 0, 200, 200)];
[dummyView setBackgroundColor:[UIColor yellowColor]];
[self.view addSubview:dummyView];}

When I run my code, the dummyView with yellow color appears on my view, yes, but with a delay of few seconds. It is really annoying!

Could you give me any idea please? When I use .xib I don't have any issues like this.

Updated

I'm going to upload a .gif:

enter image description here

Thank you!

Upvotes: 0

Views: 295

Answers (1)

Göktuğ Aral
Göktuğ Aral

Reputation: 1409

I found the solution, its really silly thing. On my project there wasn't any SplashScreen. So it was immediately launch my main and it looks like views appears after some delay.

I have added SplashScreen and everything is as it should be!

Upvotes: 1

Related Questions