 //
 
 import UIKit
+ 
 import XCGLogger
 import SVProgressHUD
 import Fabric

        SVProgressHUD.showWainningMessage(WainningMessage: "\(error)", ForDuration: 1.5, completion: nil)
    }
    
    private func appearance() {
        let navigationBar:UINavigationBar = UINavigationBar.appearance() as UINavigationBar;
//        navigationBar.setBackgroundImage(UIImage(named: "head_bg"), forBarMetrics: .Default)
        
        navigationBar.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.darkGrayColor()];
        navigationBar.translucent = false;
//        navigationBar.tintColor = UIColor.whiteColor();
        UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -60), forBarMetrics:.Default);
        UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.Default;
        UITableView.appearance().backgroundColor = AppConst.Color.C6;
        SVProgressHUD.setDefaultStyle(SVProgressHUDStyle.Dark)
        //        SVProgressHUD.setDefaultMaskType(SVProgressHUDMaskType.Gradient)
        SVProgressHUD.setMinimumDismissTimeInterval(2)
    }

//    private func regitserContact() {
//        
//        let adressRef = ABAddressBookCreate().takeRetainedValue()
//        if ABAddressBookGetAuthorizationStatus() == .NotDetermined { //还未请求通讯录权限
//            ABAddressBookRequestAccessWithCompletion(adressRef, { (granted, error) in
//            })
//        } else if ABAddressBookGetAuthorizationStatus() == .Denied || ABAddressBookGetAuthorizationStatus() == .Restricted { //拒绝访问通讯录
//            
//        } else if ABAddressBookGetAuthorizationStatus() == .Authorized { //允许访问通讯录
//            
//        }
//    }
    private func umapp(){
        MobClick.setCrashReportEnabled(false)
        UMAnalyticsConfig.sharedInstance().appKey = AppConst.UMAppkey
        UMAnalyticsConfig.sharedInstance().channelId = ""
        MobClick.startWithConfigure(UMAnalyticsConfig.sharedInstance())
        //version标识
        let version: String? = NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"] as? String
        MobClick.setAppVersion(version)
        //日志加密设置
        MobClick.setEncryptEnabled(true)
        //使用集成测试服务
        MobClick.setLogEnabled(true)
        //Crash
    }
    private func registerMapSDK() {
        var key = "46a4db80f23354f30107c349fa55387a"
        if let id = NSBundle.mainBundle().bundleIdentifier {
            if id == "com.yundian.enterprise.assistant" {
                key = "fee316e0f09979b349bfd4f9e225c907"
            } else if id == "com.yundian.assistant" {
                key = "46a4db80f23354f30107c349fa55387a"
            }else if id == "com.yundian.enterprise.trip" {
                key = "4bb6a0b7762c3f6881048a57d9d64bef"
            }
        }
        AMapServices.sharedServices().apiKey = key
    }
}


            let notifySettings = UIUserNotificationSettings.init(forTypes: [.Alert, .Badge, .Sound], categories: nil)
            UIApplication.sharedApplication().registerUserNotificationSettings(notifySettings)
            UIApplication.sharedApplication().registerForRemoteNotifications()
        })
    }
    
    private func appearance() {
        let navigationBar:UINavigationBar = UINavigationBar.appearance() as UINavigationBar
        navigationBar.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.darkGrayColor()]
        navigationBar.translucent = false
        
        UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -60), forBarMetrics:.Default)
        UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.Default
        
        UITableView.appearance().backgroundColor = AppConst.Color.C6
        
        SVProgressHUD.setDefaultStyle(SVProgressHUDStyle.Dark)
        SVProgressHUD.setMinimumDismissTimeInterval(2)
    }
    
    private func umappServiceRegister() {
        MobClick.setCrashReportEnabled(false)
        UMAnalyticsConfig.sharedInstance().appKey = AppConst.UMAppkey
        UMAnalyticsConfig.sharedInstance().channelId = ""
        MobClick.startWithConfigure(UMAnalyticsConfig.sharedInstance())
        //version标识
        let version: String? = NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"] as? String
        MobClick.setAppVersion(version)
        //日志加密设置
        MobClick.setEncryptEnabled(true)
        //使用集成测试服务
        MobClick.setLogEnabled(true)
    }
    
    private func mapServiceRegister() {
        var key = "46a4db80f23354f30107c349fa55387a"
        if let id = NSBundle.mainBundle().bundleIdentifier {
            if id == "com.yundian.enterprise.assistant" {
                key = "fee316e0f09979b349bfd4f9e225c907"
            } else if id == "com.yundian.assistant" {
                key = "46a4db80f23354f30107c349fa55387a"
            }else if id == "com.yundian.enterprise.trip" {
                key = "4bb6a0b7762c3f6881048a57d9d64bef"
            }
        }
        
        AMapServices.sharedServices().apiKey = key
    }
    
    func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
