Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to Swift 5.0 #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand All @@ -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 = "";
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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";
Expand All @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion Example/CollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CollectionViewController: UICollectionViewController, StatefulViewControll
refresh()
}

func refresh() {
@objc func refresh() {
if (lastState == .loading) { return }

startLoading {
Expand Down
2 changes: 1 addition & 1 deletion Example/PlaceholderViews/BasicPlaceholderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Example/PlaceholderViews/ErrorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Example/PlaceholderViews/LoadingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Example/TableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TableViewController: UITableViewController, StatefulViewController {
refresh()
}

func refresh() {
@objc func refresh() {
if (lastState == .loading) { return }

startLoading {
Expand Down
2 changes: 1 addition & 1 deletion Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ViewController: UIViewController, StatefulViewController {
refresh()
}

func refresh() {
@objc func refresh() {
if (lastState == .loading) { return }

startLoading {
Expand Down