Skip to content

Commit 7cffc2c

Browse files
author
sparmar
committed
Swift 5.0 syntax changes
1 parent ae65bef commit 7cffc2c

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Example/iStatusView/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
1919
let window = UIWindow.init(frame: UIScreen.main.bounds)
2020
self.window = window

Example/iStatusView/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class ViewController: UIViewController {
148148
button.setTitleColor(UIColor.black, for: .normal)
149149
button.layer.cornerRadius = 4.0
150150
button.layer.borderWidth = 1.0
151-
button.contentEdgeInsets = UIEdgeInsetsMake(5, 10, 5, 10)
151+
button.contentEdgeInsets = UIEdgeInsets.init(top: 5, left: 10, bottom: 5, right: 10)
152152
button.backgroundColor = UIColor.white
153153
button.addTarget(self, action: #selector(statusViewButtonPressed), for: .touchUpInside)
154154
self.view.addSubview(button)

iStatusView/Classes/StatusView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ extension StatusViewError: LocalizedError {
281281
self.state = state
282282

283283
if !self.isHidden {
284-
self.superview?.bringSubview(toFront: self)
284+
self.superview?.bringSubviewToFront(self)
285285
}
286286

287287
var visibleViews = [UIView]()
@@ -379,7 +379,7 @@ extension StatusViewError: LocalizedError {
379379
}
380380

381381
if initial == false || animate == false {
382-
UIView.animate(withDuration: 0.32, delay: 0.0, options:UIViewAnimationOptions.curveEaseOut, animations: {
382+
UIView.animate(withDuration: 0.32, delay: 0.0, options:UIView.AnimationOptions.curveEaseOut, animations: {
383383
// Don't animate contents if showing/hiding
384384
if !wasHidden {
385385
self.layoutIfNeeded()

0 commit comments

Comments
 (0)