Reputation: 43
Just as the title states, I am looking to have a small notification view that will be present in all views of the application. Is there a way to do this without initializing it in every single view?
Upvotes: 2
Views: 249
Reputation: 54846
@interface SharedViewManager {
}
+ (UIView*) getSharedView;
@end
@implementation SharedViewManager
static UIView* sharedView = nil;
+ (UIView*) getSharedView {
if (sharedView == nil) {
//initialize the view
}
return sharedView;
}
@end
Upvotes: 1
Reputation: 44633
Attach it to the UIWindow
object. This way it will be available on every view.
Upvotes: 3