Applied migration to Swift 4.2
This commit is contained in:
parent
b389c41ae0
commit
65a41a86b8
|
@ -311,18 +311,18 @@
|
||||||
CE412E8819D9A1E4000F294E = {
|
CE412E8819D9A1E4000F294E = {
|
||||||
CreatedOnToolsVersion = 6.0.1;
|
CreatedOnToolsVersion = 6.0.1;
|
||||||
DevelopmentTeam = 5SJ773RP6R;
|
DevelopmentTeam = 5SJ773RP6R;
|
||||||
LastSwiftMigration = 0900;
|
LastSwiftMigration = 1000;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
};
|
};
|
||||||
CE412E9D19D9A1E4000F294E = {
|
CE412E9D19D9A1E4000F294E = {
|
||||||
CreatedOnToolsVersion = 6.0.1;
|
CreatedOnToolsVersion = 6.0.1;
|
||||||
LastSwiftMigration = 0900;
|
LastSwiftMigration = 1000;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
TestTargetID = CE412E8819D9A1E4000F294E;
|
TestTargetID = CE412E8819D9A1E4000F294E;
|
||||||
};
|
};
|
||||||
CE8FFED51BAB4E7F00D43F38 = {
|
CE8FFED51BAB4E7F00D43F38 = {
|
||||||
CreatedOnToolsVersion = 7.0;
|
CreatedOnToolsVersion = 7.0;
|
||||||
LastSwiftMigration = 0900;
|
LastSwiftMigration = 1000;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -576,7 +576,7 @@
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.workandplay.qrcodereader;
|
PRODUCT_BUNDLE_IDENTIFIER = com.workandplay.qrcodereader;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.2;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -592,7 +592,7 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.workandplay.qrcodereader;
|
PRODUCT_BUNDLE_IDENTIFIER = com.workandplay.qrcodereader;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.2;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -614,7 +614,7 @@
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.yannickloriot.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.yannickloriot.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.2;
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QRCodeReader.swift.app/QRCodeReader.swift";
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QRCodeReader.swift.app/QRCodeReader.swift";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
|
@ -634,7 +634,7 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.yannickloriot.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.yannickloriot.$(PRODUCT_NAME:rfc1034identifier)";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.2;
|
||||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QRCodeReader.swift.app/QRCodeReader.swift";
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/QRCodeReader.swift.app/QRCodeReader.swift";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
@ -657,7 +657,7 @@
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.yannickloriot.QRCodeReader;
|
PRODUCT_BUNDLE_IDENTIFIER = com.yannickloriot.QRCodeReader;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.2;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
};
|
};
|
||||||
|
@ -683,7 +683,7 @@
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.2;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
VERSION_INFO_PREFIX = "";
|
VERSION_INFO_PREFIX = "";
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,7 +30,7 @@ import UIKit
|
||||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
var window: UIWindow?
|
var window: UIWindow?
|
||||||
|
|
||||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
// Override point for customization after application launch.
|
// Override point for customization after application launch.
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ class ViewController: UIViewController, QRCodeReaderViewControllerDelegate {
|
||||||
|
|
||||||
alert.addAction(UIAlertAction(title: "Setting", style: .default, handler: { (_) in
|
alert.addAction(UIAlertAction(title: "Setting", style: .default, handler: { (_) in
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
if let settingsURL = URL(string: UIApplicationOpenSettingsURLString) {
|
if let settingsURL = URL(string: UIApplication.openSettingsURLString) {
|
||||||
UIApplication.shared.openURL(settingsURL)
|
UIApplication.shared.openURL(settingsURL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ final public class QRCodeReaderView: UIView, QRCodeReaderDisplayable {
|
||||||
addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[ttb(70)]", options: [], metrics: nil, views: views))
|
addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[ttb(70)]", options: [], metrics: nil, views: views))
|
||||||
}
|
}
|
||||||
|
|
||||||
for attribute in Array<NSLayoutAttribute>([.left, .top, .right, .bottom]) {
|
for attribute in Array<NSLayoutConstraint.Attribute>([.left, .top, .right, .bottom]) {
|
||||||
addConstraint(NSLayoutConstraint(item: ov, attribute: attribute, relatedBy: .equal, toItem: cameraView, attribute: attribute, multiplier: 1, constant: 0))
|
addConstraint(NSLayoutConstraint(item: ov, attribute: attribute, relatedBy: .equal, toItem: cameraView, attribute: attribute, multiplier: 1, constant: 0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ final public class QRCodeReaderView: UIView, QRCodeReaderDisplayable {
|
||||||
// MARK: - Convenience Methods
|
// MARK: - Convenience Methods
|
||||||
|
|
||||||
private func addComponents() {
|
private func addComponents() {
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(self.setNeedsUpdateOrientation), name: .UIDeviceOrientationDidChange, object: nil)
|
NotificationCenter.default.addObserver(self, selector: #selector(self.setNeedsUpdateOrientation), name: UIDevice.orientationDidChangeNotification, object: nil)
|
||||||
|
|
||||||
addSubview(cameraView)
|
addSubview(cameraView)
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class QRCodeReaderViewController: UIViewController {
|
||||||
|
|
||||||
// Setup constraints
|
// Setup constraints
|
||||||
|
|
||||||
for attribute in [.left, .top, .right] as [NSLayoutAttribute] {
|
for attribute in [.left, .top, .right] as [NSLayoutConstraint.Attribute] {
|
||||||
NSLayoutConstraint(item: readerView.view, attribute: attribute, relatedBy: .equal, toItem: view, attribute: attribute, multiplier: 1, constant: 0).isActive = true
|
NSLayoutConstraint(item: readerView.view, attribute: attribute, relatedBy: .equal, toItem: view, attribute: attribute, multiplier: 1, constant: 0).isActive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue