There are many applications open, the Welcome screen will be loaded with a network to get the ad image or display a set of animation, how does this effect? Here is a simple way to implement loading ads.
The program runs up and the Welcome interface goes into Appdelegate, so we can do the desired effect in Application:didfinishlaunchingwithoptions: Add code. Web Capture images can be implemented with third-party sdwebimage, so you need to import third-party folders first. Because the page that displays the ad is displayed on the Welcome screen, you can use the Launchscreen.xib view to add a uiimageview display image on top of it, and then put it on the window and display it on top. After the ad image is displayed, the view is removed and the program's main screen is displayed. The code looks like this:
#import "AppDelegate.h" #import "uiimageview+webcache.h" @interface appdelegate () @property (Strong, nonatomic) UIView * Lunchview; @end @implementation appdelegate@synthesize lunchview;-(BOOL) Application: (UIApplication *) application Didfinishlaunchingwithoptions: (nsdictionary *) launchoptions {[Self.window makekeyandvisible]; Lunchview = [[NSBundle mainbundle]loadnibnamed:@ "Launchscreen" Owner:nil options:nil][0]; Lunchview.frame = CGRectMake (0, 0, self.window.screen.bounds.size.width, self.window.screen.bounds.size.height); [Self.window Addsubview:lunchview]; Uiimageview *imagev = [[Uiimageview alloc] Initwithframe:cgrectmake (0, 50, 320, 300)]; NSString *str = @ "Http://www.jerehedu.com/images/temp/logo.gif"; [Imagev sd_setimagewithurl:[nsurl urlwithstring:str] placeholderimage:[uiimage imagenamed:@ "default1.jpg"]; [Lunchview Addsubview:imagev]; [Self.window Bringsubviewtofront:lunchview]; [Nstimer scheduledtimerwithtimeinterval:3 target:self selector: @selector (Removelun) Userinfo:nil Repeats:no]; return YES;} -(void) removelun{[Lunchview Removefromsuperview];}
iOS Welcome Interface Launch screen dynamic load ads