diff --git a/Example.xcodeproj/project.pbxproj b/Example.xcodeproj/project.pbxproj index 9fa81a5..da6a441 100644 --- a/Example.xcodeproj/project.pbxproj +++ b/Example.xcodeproj/project.pbxproj @@ -515,6 +515,7 @@ PRODUCT_NAME = StatefulViewController; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -539,6 +540,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.aschuch.StatefulViewController; PRODUCT_NAME = StatefulViewController; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -558,6 +560,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.aschuch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; }; name = Debug; @@ -572,6 +575,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.aschuch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; }; name = Release; @@ -671,6 +675,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.aschuch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -682,6 +687,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.aschuch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -703,6 +709,7 @@ PRODUCT_NAME = StatefulViewController; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -729,6 +736,7 @@ PRODUCT_NAME = StatefulViewController; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/Example/AppDelegate.swift b/Example/AppDelegate.swift index f1eb6df..9320d87 100644 --- a/Example/AppDelegate.swift +++ b/Example/AppDelegate.swift @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { // Override point for customization after application launch. return true } diff --git a/Example/CollectionViewController.swift b/Example/CollectionViewController.swift index fd85a51..c83a76d 100644 --- a/Example/CollectionViewController.swift +++ b/Example/CollectionViewController.swift @@ -36,7 +36,7 @@ class CollectionViewController: UICollectionViewController, StatefulViewControll refresh() } - func refresh() { + @objc func refresh() { if (lastState == .loading) { return } startLoading { diff --git a/Example/PlaceholderViews/BasicPlaceholderView.swift b/Example/PlaceholderViews/BasicPlaceholderView.swift index 1ec110d..e5c5440 100644 --- a/Example/PlaceholderViews/BasicPlaceholderView.swift +++ b/Example/PlaceholderViews/BasicPlaceholderView.swift @@ -33,7 +33,7 @@ class BasicPlaceholderView: UIView { let vConstraints = NSLayoutConstraint.constraints(withVisualFormat: "|-(>=20)-[centerView]-(>=20)-|", options: .alignAllCenterX, metrics: nil, views: ["centerView": centerView]) let hConstraint = NSLayoutConstraint(item: centerView, attribute: .centerY, relatedBy: .equal, toItem: self, attribute: .centerY, multiplier: 1.0, constant: 0.0) let centerConstraint = NSLayoutConstraint(item: centerView, attribute: .centerX, relatedBy: .equal, toItem: self, attribute: .centerX, multiplier: 1.0, constant: 0.0) - centerConstraint.priority = 750 + centerConstraint.priority = UILayoutPriority(rawValue: 750) addConstraints(vConstraints) addConstraint(hConstraint) diff --git a/Example/PlaceholderViews/ErrorView.swift b/Example/PlaceholderViews/ErrorView.swift index 3ac5a6e..8c27403 100644 --- a/Example/PlaceholderViews/ErrorView.swift +++ b/Example/PlaceholderViews/ErrorView.swift @@ -30,7 +30,7 @@ class ErrorView: BasicPlaceholderView { detailTextLabel.text = "Tap to reload" detailTextLabel.numberOfLines = 0 detailTextLabel.textAlignment = .center - let fontDescriptor = UIFontDescriptor.preferredFontDescriptor(withTextStyle: UIFontTextStyle.footnote) + let fontDescriptor = UIFontDescriptor.preferredFontDescriptor(withTextStyle: UIFont.TextStyle.footnote) detailTextLabel.font = UIFont(descriptor: fontDescriptor, size: 0) detailTextLabel.textAlignment = .center detailTextLabel.textColor = UIColor.gray diff --git a/Example/PlaceholderViews/LoadingView.swift b/Example/PlaceholderViews/LoadingView.swift index 705502c..94de137 100644 --- a/Example/PlaceholderViews/LoadingView.swift +++ b/Example/PlaceholderViews/LoadingView.swift @@ -20,7 +20,7 @@ class LoadingView: BasicPlaceholderView, StatefulPlaceholderView { label.translatesAutoresizingMaskIntoConstraints = false centerView.addSubview(label) - let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray) + let activityIndicator = UIActivityIndicatorView(style: .gray) activityIndicator.startAnimating() activityIndicator.translatesAutoresizingMaskIntoConstraints = false centerView.addSubview(activityIndicator) diff --git a/Example/TableViewController.swift b/Example/TableViewController.swift index 2f46c43..d47870a 100644 --- a/Example/TableViewController.swift +++ b/Example/TableViewController.swift @@ -34,7 +34,7 @@ class TableViewController: UITableViewController, StatefulViewController { refresh() } - func refresh() { + @objc func refresh() { if (lastState == .loading) { return } startLoading { diff --git a/Example/ViewController.swift b/Example/ViewController.swift index bfc7bf3..4bd7f74 100644 --- a/Example/ViewController.swift +++ b/Example/ViewController.swift @@ -36,7 +36,7 @@ class ViewController: UIViewController, StatefulViewController { refresh() } - func refresh() { + @objc func refresh() { if (lastState == .loading) { return } startLoading {