Skip to content

Commit

Permalink
Update to swift 5.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 275872050
  • Loading branch information
Samuel Stow authored and maddevrelgithubbot committed Oct 21, 2019
1 parent 7cace2b commit daec450
Show file tree
Hide file tree
Showing 32 changed files with 61 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
TargetAttributes = {
849326AF1B066A7E00863759 = {
CreatedOnToolsVersion = 6.2;

LastSwiftMigration = 0900;
};
};
Expand All @@ -107,6 +106,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion Swift/admob/BannerExample/BannerExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit daec450

Please sign in to comment.