 
 import UIKit
 import SystemConfiguration
+import CoreTelephony
 
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate {


    
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        if(!isConnectedToNetwork()){
            
        }

        // Override point for customization after application launch.
        return true
    }

        let isReachable = (flags & UInt32(kSCNetworkFlagsReachable)) != 0
        let isWWAN = (flags & UInt32(kSCNetworkReachabilityFlagsIsWWAN)) != 0
        
        if(isReachable || isWWAN){
            // Have connection
            if (isWWAN){
                // Setup the Network Info and create a CTCarrier object
                var networkInfo = CTTelephonyNetworkInfo()
                var carrier = networkInfo.subscriberCellularProvider
                
                // Get carrier name
                var carrierName = carrier.carrierName
            }
            
            return true
        }
        return false;
    }

