Skip to content

Commit

Permalink
CMOB-1594: Swift (#30)
Browse files Browse the repository at this point in the history
* CMOB-1594: Update to Swift 4.2

* CMOB-1594: Remove team

* CMOB-1594: Fix linter
  • Loading branch information
kerr-marinmiller-hs authored Nov 26, 2018
1 parent 5dd07b6 commit fd3a902
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions OwlBanners.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -547,6 +548,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.hootsuite.OwlBannersDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -571,6 +573,7 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -594,6 +597,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down Expand Up @@ -732,6 +736,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -755,6 +760,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions Sources/OwlBanners/Banner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public struct BannerDisplayMetrics {
}
super.init()
UIDevice.current.beginGeneratingDeviceOrientationNotifications()
NotificationCenter.default.addObserver(self, selector: #selector(Banner.deviceOrientationDidChange(_:)), name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Banner.applicationWillChangeStatusBarFrame(_:)), name: NSNotification.Name.UIApplicationWillChangeStatusBarFrame, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Banner.deviceOrientationDidChange(_:)), name: UIDevice.orientationDidChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Banner.applicationWillChangeStatusBarFrame(_:)), name: UIApplication.willChangeStatusBarFrameNotification, object: nil)
}

deinit {
Expand Down
2 changes: 1 addition & 1 deletion Sources/OwlBanners/DefaultBannerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DefaultBannerView: UIView, BannerView {
override func awakeFromNib() {
super.awakeFromNib()
let contentSize = Banner.application?.preferredContentSizeCategory ?? .medium
let descriptor = UIFontDescriptor.preferredFontDescriptor(withTextStyle: UIFontTextStyle.body)
let descriptor = UIFontDescriptor.preferredFontDescriptor(withTextStyle: UIFont.TextStyle.body)
titleLabel.font = UIFont(descriptor: descriptor.withSize(DefaultBannerView.fontSizes[contentSize] ?? 17), size: 0)
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/OwlBannersDemo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Banner.application = UIApplication.shared
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
Banner.application = application
return true
}
}
Expand Down

0 comments on commit fd3a902

Please sign in to comment.