/*
-----------用于适配的宏
*/
//屏幕宽度的宏
#define SCREEN_W [UIScreen mainScreen].bounds.size.width
//屏幕宽度的高
#define SCREEN_H [UIScreen mainScreen].bounds.size.height
//适配x轴的宏
#define FIT_X(w) (SCREEN_W / 375. * (w))
//适配y轴的宏
#define FIT_Y(h) (SCREEN_H / 667. * (h))
/*
----------当前版本号的宏
*/
#define VERSION_CURRENT [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleShortVersionString"]
#define NOT_FIRST_LANUCH @"NotFirstLanuch"
//
// AppDelegate.h
// ofo
//
// Created by xxx on 2017/11/4.
// Copyright © 2017年 XDC. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import "RESideMenu.h" //抽屉视图第三方
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property(strong,nonatomic)RESideMenu *sideMenu;
@property (strong, nonatomic) UIWindow *window;
@property (readonly, strong) NSPersistentContainer *persistentContainer;
- (void)saveContext;
@end
//
// AppDelegate.m
// ofo
//
// Created by xxx on 2017/11/4.
// Copyright © 2017年 XDC. All rights reserved.
//
#import "AppDelegate.h"
#import "LeftMenuViewController.h"
#import "QQQViewController.h"
#import "MapViewController.h"
#import "GuideViewController.h"
@interface AppDelegate ()
@property(nonatomic,strong)LeftMenuViewController *leftVC ; //左侧菜单控制器
@property(nonatomic,strong)UITabBarController *tabBarCtl;//标签栏控制器
@end
@implementation AppDelegate
//私有方法,用于生成一个导航控制器 父类指向子类, 叫做多态
-(UINavigationController *)creatNavigationWithController:(UIViewController *)vc title:(NSString *)title image:(NSString *)imgName selectImage:(NSString *)selImgName{
UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:vc] ;
vc.navigationItem.title = title ;
nav.tabBarItem = [[UITabBarItem alloc]initWithTitle:title image:[UIImage imageNamed:imgName] selectedImage:[UIImage imageNamed:selImgName]];
return nav;
}
//左侧菜单
-(LeftMenuViewController *)leftVC {
if (!_leftVC) {
_leftVC = [[LeftMenuViewController alloc]init];
}
return _leftVC ;
}
//标签栏控制器
-(UITabBarController *)tabBarCtl {
if (!_tabBarCtl) {
_tabBarCtl = [[UITabBarController alloc]init] ;
UINavigationController *newsNav = [self creatNavigationWithController:[[MapViewController alloc]ini