Reputation: 678
I should add a UIView to an application, I use:
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
[window addSubview:view];
But it only work on SpringBoard. Have anyone an idea?
Upvotes: 0
Views: 83
Reputation: 135588
There is nothing wrong with your code and it will work. If it doesn't, view
might be nil
or the view's frame
might not be set correctly.
Normally, you would use a view controller and, rather than adding views directly to the window, you would add them to the view controller's view.
Upvotes: 1