I’m trying to show an onscreen tutorial (like a picture with hints) in my viewController. I only know how to “open” a UIView with its drawRect method, where my paint code is inside, from the AppDelegate with:
BannerView *view = [[BannerView alloc] initWithFrame:self.window.frame];
[self.window addSubview:view];
[self.window makeKeyAndVisible];
Is it possible to activate the UIView (BannerView) by a button from inside a ViewController?
Thank you very much!
Simply use this code:
in your button action method (if it is defined in your controller class). See this S.O. question to know how to create a button programmatically. Otherwise, you can use interface builder for that.
Using
self.view.boundsininitWithFramewill make your banner view as large as the controller’s view (which could be smaller than the display).