HDwallpaper/HD wallpaper/AppDelegate.m
2024-07-03 17:31:03 +08:00

69 lines
3.2 KiB
Objective-C

//
// AppDelegate.m
#import "AppDelegate.h"
#import "WPOnePageViewController.h"
#import "WPHotViewController.h"
#import "WPEditViewController.h"
#import "WPForMyViewController.h"
#import "WallPapaerADManager.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[WallPapaerADManager shareInstance] configureAD];
[[WallPapaerADManager shareInstance] initOpenAD];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
WPOnePageViewController *wpHome = [[WPOnePageViewController alloc] init];
wpHome.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[[UIImage imageNamed:@"tab1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tab11"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
UINavigationController *wpHomeNV = [[UINavigationController alloc] initWithRootViewController:wpHome];
WPHotViewController *wpHot = [[WPHotViewController alloc] init];
wpHot.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[[UIImage imageNamed:@"tab2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tab22"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
UINavigationController *wpHotNV = [[UINavigationController alloc] initWithRootViewController:wpHot];
WPEditViewController *wpEdit = [[WPEditViewController alloc] init];
wpEdit.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[[UIImage imageNamed:@"tab3"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tab33"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
UINavigationController *wpEditNV = [[UINavigationController alloc] initWithRootViewController:wpEdit];
WPForMyViewController *wpMy = [[WPForMyViewController alloc] init];
wpMy.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:[[UIImage imageNamed:@"tab4"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tab44"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
UINavigationController *wpMyNV = [[UINavigationController alloc] initWithRootViewController:wpMy];
UITabBarController *tb = [[UITabBarController alloc] init];
tb.tabBar.backgroundColor = WP_COLOR_WITH_HEX(0xFFFFFF);
tb.tabBar.tintColor = [UIColor orangeColor];
UITabBarAppearance *skappearance = [[UITabBarAppearance alloc] init];
skappearance.backgroundColor = WP_COLOR_WITH_HEX(0x6B77F2);
tb.tabBar.standardAppearance = skappearance;
tb.viewControllers = @[wpHomeNV,wpHotNV,wpEditNV,wpMyNV];
tb.selectedIndex = 0;
self.window.rootViewController = tb;
[self.window makeKeyAndVisible];
return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[WallPapaerADManager shareInstance] showOpenAD];
}
- (NSMutableArray *)saveImages{
if (!_saveImages) {
_saveImages = [[NSMutableArray alloc] init];
}
return _saveImages;
}
@end