diff --git a/Swift/admanager/AdManagerBannerExample/AdManagerBannerExample.xcodeproj/project.pbxproj b/Swift/admanager/AdManagerBannerExample/AdManagerBannerExample.xcodeproj/project.pbxproj index 82ee7762..413cdcbb 100644 --- a/Swift/admanager/AdManagerBannerExample/AdManagerBannerExample.xcodeproj/project.pbxproj +++ b/Swift/admanager/AdManagerBannerExample/AdManagerBannerExample.xcodeproj/project.pbxproj @@ -269,7 +269,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.google.ads.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -286,7 +286,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.google.ads.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admanager/AdManagerBannerExample/AdManagerBannerExample/AppDelegate.swift b/Swift/admanager/AdManagerBannerExample/AdManagerBannerExample/AppDelegate.swift index d5e05e84..b099afcc 100644 --- a/Swift/admanager/AdManagerBannerExample/AdManagerBannerExample/AppDelegate.swift +++ b/Swift/admanager/AdManagerBannerExample/AdManagerBannerExample/AppDelegate.swift @@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { return true } diff --git a/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample.xcodeproj/project.pbxproj b/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample.xcodeproj/project.pbxproj index 8058b144..65170e6e 100644 --- a/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample.xcodeproj/project.pbxproj +++ b/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample.xcodeproj/project.pbxproj @@ -295,7 +295,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.AdManagerCustomRenderingExample; PRODUCT_NAME = AdManagerCustomRenderingExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -310,7 +310,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.AdManagerCustomRenderingExample; PRODUCT_NAME = AdManagerCustomRenderingExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample/AppDelegate.swift b/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample/AppDelegate.swift index d5e05e84..b099afcc 100644 --- a/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample/AppDelegate.swift +++ b/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample/AppDelegate.swift @@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { return true } diff --git a/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample/ViewController.swift b/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample/ViewController.swift index 5e3a34a7..30f7066d 100644 --- a/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample/ViewController.swift +++ b/Swift/admanager/AdManagerCustomRenderingExample/AdManagerCustomRenderingExample/ViewController.swift @@ -70,9 +70,9 @@ class ViewController: UIViewController { // of the nativeAdPlaceholder. let viewDictionary = ["_nativeAdView": nativeAdView!] self.view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[_nativeAdView]|", - options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) self.view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[_nativeAdView]|", - options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) } // MARK: - Actions diff --git a/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample.xcodeproj/project.pbxproj b/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample.xcodeproj/project.pbxproj index f2ba02c5..a6d6a3bb 100644 --- a/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample.xcodeproj/project.pbxproj +++ b/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample.xcodeproj/project.pbxproj @@ -268,7 +268,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.google.ads.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -284,7 +284,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.google.ads.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample/AppDelegate.swift b/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample/AppDelegate.swift index d5e05e84..b099afcc 100644 --- a/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample/AppDelegate.swift +++ b/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample/AppDelegate.swift @@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { return true } diff --git a/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample/ViewController.swift b/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample/ViewController.swift index 8be81db9..2248336e 100644 --- a/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample/ViewController.swift +++ b/Swift/admanager/AdManagerInterstitialExample/AdManagerInterstitialExample/ViewController.swift @@ -59,12 +59,12 @@ class ViewController: UIViewController, GADInterstitialDelegate, UIAlertViewDele // Pause game when application enters background. NotificationCenter.default.addObserver(self, selector: #selector(ViewController.pauseGame), - name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + name: UIApplication.didEnterBackgroundNotification, object: nil) // Resume game when application becomes active. NotificationCenter.default.addObserver(self, selector: #selector(ViewController.resumeGame), - name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) + name: UIApplication.didBecomeActiveNotification, object: nil) startNewGame() } @@ -161,9 +161,9 @@ class ViewController: UIViewController, GADInterstitialDelegate, UIAlertViewDele deinit { NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + name: UIApplication.didEnterBackgroundNotification, object: nil) NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) + name: UIApplication.didBecomeActiveNotification, object: nil) } } diff --git a/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample.xcodeproj/project.pbxproj b/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample.xcodeproj/project.pbxproj index 4a37356d..430f5504 100644 --- a/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample.xcodeproj/project.pbxproj +++ b/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample.xcodeproj/project.pbxproj @@ -97,7 +97,6 @@ TargetAttributes = { 849326AF1B066A7E00863759 = { CreatedOnToolsVersion = 6.2; - LastSwiftMigration = 0900; }; }; @@ -107,6 +106,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -267,7 +267,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample; PRODUCT_NAME = AdManagerRewardedVideoExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -282,7 +282,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample; PRODUCT_NAME = AdManagerRewardedVideoExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/AppDelegate.swift b/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/AppDelegate.swift index ab83e09a..92859a61 100644 --- a/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/AppDelegate.swift +++ b/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/AppDelegate.swift @@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { return true } diff --git a/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/ViewController.swift b/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/ViewController.swift index 3c518893..7e919952 100644 --- a/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/ViewController.swift +++ b/Swift/admanager/AdManagerRewardedVideoExample/AdManagerRewardedVideoExample/ViewController.swift @@ -72,12 +72,12 @@ class ViewController: UIViewController, GADRewardedAdDelegate, UIAlertViewDelega // Pause game when application is backgrounded. NotificationCenter.default.addObserver(self, selector: #selector(ViewController.applicationDidEnterBackground(_:)), - name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + name: UIApplication.didEnterBackgroundNotification, object: nil) // Resume game when application is returned to foreground. NotificationCenter.default.addObserver(self, selector: #selector(ViewController.applicationDidBecomeActive(_:)), - name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) + name: UIApplication.didBecomeActiveNotification, object: nil) startNewGame() } @@ -205,8 +205,8 @@ class ViewController: UIViewController, GADRewardedAdDelegate, UIAlertViewDelega deinit { NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + name: UIApplication.didEnterBackgroundNotification, object: nil) NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) + name: UIApplication.didBecomeActiveNotification, object: nil) } } diff --git a/Swift/admanager/AdaptiveBannerExample/AdaptiveBannerExample.xcodeproj/project.pbxproj b/Swift/admanager/AdaptiveBannerExample/AdaptiveBannerExample.xcodeproj/project.pbxproj index f8fd098a..a8d82b91 100644 --- a/Swift/admanager/AdaptiveBannerExample/AdaptiveBannerExample.xcodeproj/project.pbxproj +++ b/Swift/admanager/AdaptiveBannerExample/AdaptiveBannerExample.xcodeproj/project.pbxproj @@ -263,7 +263,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/AdaptiveBannerExample/AdaptiveBannerExample-BridgingHeader.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -280,7 +280,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.google.example.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/AdaptiveBannerExample/AdaptiveBannerExample-BridgingHeader.h"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admanager/AdaptiveBannerExample/AdaptiveBannerExample/ViewController.swift b/Swift/admanager/AdaptiveBannerExample/AdaptiveBannerExample/ViewController.swift index b8a66aa2..ee2fc390 100644 --- a/Swift/admanager/AdaptiveBannerExample/AdaptiveBannerExample/ViewController.swift +++ b/Swift/admanager/AdaptiveBannerExample/AdaptiveBannerExample/ViewController.swift @@ -63,7 +63,7 @@ class ViewController: UIViewController { @IBAction func loadBannerAd(_ sender: Any?) { let frame = { () -> CGRect in if #available(iOS 11.0, *) { - return UIEdgeInsetsInsetRect(view.frame, view.safeAreaInsets) + return view.frame.inset(by: view.safeAreaInsets) } else { return view.frame } diff --git a/Swift/admob/AdaptiveBannerExample/AdaptiveBannerExample.xcodeproj/project.pbxproj b/Swift/admob/AdaptiveBannerExample/AdaptiveBannerExample.xcodeproj/project.pbxproj index 9433aea5..3103d42d 100644 --- a/Swift/admob/AdaptiveBannerExample/AdaptiveBannerExample.xcodeproj/project.pbxproj +++ b/Swift/admob/AdaptiveBannerExample/AdaptiveBannerExample.xcodeproj/project.pbxproj @@ -258,7 +258,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.google.example.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -273,7 +273,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.google.example.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admob/AdaptiveBannerExample/AdaptiveBannerExample/ViewController.swift b/Swift/admob/AdaptiveBannerExample/AdaptiveBannerExample/ViewController.swift index e6911903..784bfdf6 100644 --- a/Swift/admob/AdaptiveBannerExample/AdaptiveBannerExample/ViewController.swift +++ b/Swift/admob/AdaptiveBannerExample/AdaptiveBannerExample/ViewController.swift @@ -49,7 +49,7 @@ class ViewController: UIViewController { // view has been laid out. let frame = { () -> CGRect in if #available(iOS 11.0, *) { - return UIEdgeInsetsInsetRect(view.frame, view.safeAreaInsets) + return view.frame.inset(by: view.safeAreaInsets) } else { return view.frame } diff --git a/Swift/admob/BannerExample/BannerExample.xcodeproj/project.pbxproj b/Swift/admob/BannerExample/BannerExample.xcodeproj/project.pbxproj index cc7b41c7..b8fe3cca 100644 --- a/Swift/admob/BannerExample/BannerExample.xcodeproj/project.pbxproj +++ b/Swift/admob/BannerExample/BannerExample.xcodeproj/project.pbxproj @@ -274,7 +274,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.BannerExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -290,7 +290,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.BannerExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admob/BannerExample/BannerExample/AppDelegate.swift b/Swift/admob/BannerExample/BannerExample/AppDelegate.swift index c821f85d..36bfd24f 100644 --- a/Swift/admob/BannerExample/BannerExample/AppDelegate.swift +++ b/Swift/admob/BannerExample/BannerExample/AppDelegate.swift @@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize Google Mobile Ads SDK GADMobileAds.sharedInstance().start(completionHandler: nil) diff --git a/Swift/admob/InterstitialExample/InterstitialExample.xcodeproj/project.pbxproj b/Swift/admob/InterstitialExample/InterstitialExample.xcodeproj/project.pbxproj index e546e387..171a8a21 100644 --- a/Swift/admob/InterstitialExample/InterstitialExample.xcodeproj/project.pbxproj +++ b/Swift/admob/InterstitialExample/InterstitialExample.xcodeproj/project.pbxproj @@ -275,7 +275,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.google.ads.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -291,7 +291,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.google.ads.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admob/InterstitialExample/InterstitialExample/AppDelegate.swift b/Swift/admob/InterstitialExample/InterstitialExample/AppDelegate.swift index c821f85d..36bfd24f 100644 --- a/Swift/admob/InterstitialExample/InterstitialExample/AppDelegate.swift +++ b/Swift/admob/InterstitialExample/InterstitialExample/AppDelegate.swift @@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize Google Mobile Ads SDK GADMobileAds.sharedInstance().start(completionHandler: nil) diff --git a/Swift/admob/InterstitialExample/InterstitialExample/ViewController.swift b/Swift/admob/InterstitialExample/InterstitialExample/ViewController.swift index ded9f9bf..937d4028 100644 --- a/Swift/admob/InterstitialExample/InterstitialExample/ViewController.swift +++ b/Swift/admob/InterstitialExample/InterstitialExample/ViewController.swift @@ -59,12 +59,12 @@ class ViewController: UIViewController, UIAlertViewDelegate { // Pause game when application enters background. NotificationCenter.default.addObserver(self, selector: #selector(ViewController.pauseGame), - name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + name: UIApplication.didEnterBackgroundNotification, object: nil) // Resume game when application becomes active. NotificationCenter.default.addObserver(self, selector: #selector(ViewController.resumeGame), - name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) + name: UIApplication.didBecomeActiveNotification, object: nil) startNewGame() } @@ -165,9 +165,9 @@ class ViewController: UIViewController, UIAlertViewDelegate { deinit { NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + name: UIApplication.didEnterBackgroundNotification, object: nil) NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) + name: UIApplication.didBecomeActiveNotification, object: nil) } } diff --git a/Swift/admob/NativeAdvancedExample/NativeAdvancedExample.xcodeproj/project.pbxproj b/Swift/admob/NativeAdvancedExample/NativeAdvancedExample.xcodeproj/project.pbxproj index 59db2a11..822fe4d8 100644 --- a/Swift/admob/NativeAdvancedExample/NativeAdvancedExample.xcodeproj/project.pbxproj +++ b/Swift/admob/NativeAdvancedExample/NativeAdvancedExample.xcodeproj/project.pbxproj @@ -277,7 +277,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.NativeAdvancedExample; PRODUCT_NAME = NativeAdvancedExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -293,7 +293,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.NativeAdvancedExample; PRODUCT_NAME = NativeAdvancedExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Swift/admob/NativeAdvancedExample/NativeAdvancedExample/AppDelegate.swift b/Swift/admob/NativeAdvancedExample/NativeAdvancedExample/AppDelegate.swift index 5b26e8bb..12ecfc67 100644 --- a/Swift/admob/NativeAdvancedExample/NativeAdvancedExample/AppDelegate.swift +++ b/Swift/admob/NativeAdvancedExample/NativeAdvancedExample/AppDelegate.swift @@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize Google Mobile Ads SDK. GADMobileAds.sharedInstance().start(completionHandler: nil) diff --git a/Swift/admob/NativeAdvancedExample/NativeAdvancedExample/ViewController.swift b/Swift/admob/NativeAdvancedExample/NativeAdvancedExample/ViewController.swift index 39c01d8e..70e1d49f 100644 --- a/Swift/admob/NativeAdvancedExample/NativeAdvancedExample/ViewController.swift +++ b/Swift/admob/NativeAdvancedExample/NativeAdvancedExample/ViewController.swift @@ -69,9 +69,9 @@ class ViewController: UIViewController { // of the nativeAdPlaceholder. let viewDictionary = ["_nativeAdView": nativeAdView!] self.view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[_nativeAdView]|", - options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) self.view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[_nativeAdView]|", - options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) } // MARK: - Actions diff --git a/Swift/admob/RewardedVideoExample/RewardedVideoExample.xcodeproj/project.pbxproj b/Swift/admob/RewardedVideoExample/RewardedVideoExample.xcodeproj/project.pbxproj index 03aa2e33..ad00b239 100644 --- a/Swift/admob/RewardedVideoExample/RewardedVideoExample.xcodeproj/project.pbxproj +++ b/Swift/admob/RewardedVideoExample/RewardedVideoExample.xcodeproj/project.pbxproj @@ -274,7 +274,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample; PRODUCT_NAME = RewardedVideoExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -289,7 +289,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.google.ads.RewardedVideoExample; PRODUCT_NAME = RewardedVideoExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/admob/RewardedVideoExample/RewardedVideoExample/AppDelegate.swift b/Swift/admob/RewardedVideoExample/RewardedVideoExample/AppDelegate.swift index 8277eb46..9c08db66 100644 --- a/Swift/admob/RewardedVideoExample/RewardedVideoExample/AppDelegate.swift +++ b/Swift/admob/RewardedVideoExample/RewardedVideoExample/AppDelegate.swift @@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize Google Mobile Ads SDK GADMobileAds.sharedInstance().start(completionHandler: nil) diff --git a/Swift/admob/RewardedVideoExample/RewardedVideoExample/ViewController.swift b/Swift/admob/RewardedVideoExample/RewardedVideoExample/ViewController.swift index d859fe55..bcbf3cc1 100644 --- a/Swift/admob/RewardedVideoExample/RewardedVideoExample/ViewController.swift +++ b/Swift/admob/RewardedVideoExample/RewardedVideoExample/ViewController.swift @@ -72,12 +72,12 @@ class ViewController: UIViewController, GADRewardedAdDelegate, UIAlertViewDelega // Pause game when application is backgrounded. NotificationCenter.default.addObserver(self, selector: #selector(ViewController.applicationDidEnterBackground(_:)), - name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + name: UIApplication.didEnterBackgroundNotification, object: nil) // Resume game when application is returned to foreground. NotificationCenter.default.addObserver(self, selector: #selector(ViewController.applicationDidBecomeActive(_:)), - name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) + name: UIApplication.didBecomeActiveNotification, object: nil) startNewGame() } @@ -204,8 +204,8 @@ class ViewController: UIViewController, GADRewardedAdDelegate, UIAlertViewDelega deinit { NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + name: UIApplication.didEnterBackgroundNotification, object: nil) NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) + name: UIApplication.didBecomeActiveNotification, object: nil) } } diff --git a/Swift/advanced/APIDemo/APIDemo.xcodeproj/project.pbxproj b/Swift/advanced/APIDemo/APIDemo.xcodeproj/project.pbxproj index 02676ca4..11971468 100644 --- a/Swift/advanced/APIDemo/APIDemo.xcodeproj/project.pbxproj +++ b/Swift/advanced/APIDemo/APIDemo.xcodeproj/project.pbxproj @@ -352,7 +352,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "APIDemo/APIDemo-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -370,7 +370,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "APIDemo/APIDemo-Bridging-Header.h"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/advanced/APIDemo/APIDemo/AdMobNativeCustomMuteThisAdViewController.swift b/Swift/advanced/APIDemo/APIDemo/AdMobNativeCustomMuteThisAdViewController.swift index 428b7a1c..0962a266 100644 --- a/Swift/advanced/APIDemo/APIDemo/AdMobNativeCustomMuteThisAdViewController.swift +++ b/Swift/advanced/APIDemo/APIDemo/AdMobNativeCustomMuteThisAdViewController.swift @@ -78,9 +78,9 @@ class AdMobNativeCustomMuteThisAdViewController: UIViewController { // of the nativeAdPlaceholder. let viewDictionary = ["_nativeAdView": nativeAdView!] self.view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[_nativeAdView]|", - options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) self.view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[_nativeAdView]|", - options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: viewDictionary)) } // MARK: - Actions diff --git a/Swift/advanced/APIDemo/APIDemo/AppDelegate.swift b/Swift/advanced/APIDemo/APIDemo/AppDelegate.swift index cf3d6c94..b078b7f3 100644 --- a/Swift/advanced/APIDemo/APIDemo/AppDelegate.swift +++ b/Swift/advanced/APIDemo/APIDemo/AppDelegate.swift @@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { return true } diff --git a/Swift/advanced/BannerTableViewExample/BannerTableViewExample.xcodeproj/project.pbxproj b/Swift/advanced/BannerTableViewExample/BannerTableViewExample.xcodeproj/project.pbxproj index f38b751f..cd341cbc 100644 --- a/Swift/advanced/BannerTableViewExample/BannerTableViewExample.xcodeproj/project.pbxproj +++ b/Swift/advanced/BannerTableViewExample/BannerTableViewExample.xcodeproj/project.pbxproj @@ -294,7 +294,7 @@ SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -315,7 +315,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Swift/advanced/BannerTableViewExample/BannerTableViewExample/AppDelegate.swift b/Swift/advanced/BannerTableViewExample/BannerTableViewExample/AppDelegate.swift index 6e1c95de..a9df0b86 100644 --- a/Swift/advanced/BannerTableViewExample/BannerTableViewExample/AppDelegate.swift +++ b/Swift/advanced/BannerTableViewExample/BannerTableViewExample/AppDelegate.swift @@ -23,7 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize the Google Mobile Ads SDK with the AdMob application ID. GADMobileAds.sharedInstance().start(completionHandler: nil) diff --git a/Swift/advanced/BannerTableViewExample/BannerTableViewExample/TableViewController.swift b/Swift/advanced/BannerTableViewExample/BannerTableViewExample/TableViewController.swift index dc2d344c..0472ce8a 100644 --- a/Swift/advanced/BannerTableViewExample/BannerTableViewExample/TableViewController.swift +++ b/Swift/advanced/BannerTableViewExample/BannerTableViewExample/TableViewController.swift @@ -41,7 +41,7 @@ class TableViewController: UITableViewController, GADBannerViewDelegate { forCellReuseIdentifier: "BannerViewCell") // Allow row height to be determined dynamically while optimizing with an estimated row height. - tableView.rowHeight = UITableViewAutomaticDimension + tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = 135 // Load the sample data. @@ -62,7 +62,7 @@ class TableViewController: UITableViewController, GADBannerViewDelegate { let isAdLoaded = loadStateForAds[tableItem] return isAdLoaded == true ? adViewHeight : 0 } - return UITableViewAutomaticDimension + return UITableView.automaticDimension } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {