diff --git a/Swift VectorBoolean.xcodeproj/project.pbxproj b/Swift VectorBoolean.xcodeproj/project.pbxproj index bae5bae..c9412b3 100644 --- a/Swift VectorBoolean.xcodeproj/project.pbxproj +++ b/Swift VectorBoolean.xcodeproj/project.pbxproj @@ -620,6 +620,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -634,6 +635,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.starside.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Swift VectorBoolean/AppDelegate.swift b/Swift VectorBoolean/AppDelegate.swift index 6aad9df..46ffa67 100644 --- a/Swift VectorBoolean/AppDelegate.swift +++ b/Swift VectorBoolean/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Override point for customization after application launch. return true } diff --git a/Swift VectorBoolean/OptionsViewController.swift b/Swift VectorBoolean/OptionsViewController.swift index 0c00719..09ee83d 100644 --- a/Swift VectorBoolean/OptionsViewController.swift +++ b/Swift VectorBoolean/OptionsViewController.swift @@ -60,7 +60,7 @@ class OptionsViewController: UIViewController { } } - func dismissVC() { + @objc func dismissVC() { self.dismiss(animated: true) { self.primeVC?.popClosed() } diff --git a/Swift VectorBoolean/ShapesTableViewController.swift b/Swift VectorBoolean/ShapesTableViewController.swift index 64d65a0..0afdbf1 100644 --- a/Swift VectorBoolean/ShapesTableViewController.swift +++ b/Swift VectorBoolean/ShapesTableViewController.swift @@ -35,7 +35,7 @@ class ShapesTableViewController: UITableViewController { } override func viewWillAppear(_ animated: Bool) { - tableView.selectRow(at: IndexPath(item: currentSelection, section: 0), animated: true, scrollPosition: UITableViewScrollPosition.middle) + tableView.selectRow(at: IndexPath(item: currentSelection, section: 0), animated: true, scrollPosition: UITableView.ScrollPosition.middle) } override func didReceiveMemoryWarning() { @@ -44,7 +44,7 @@ class ShapesTableViewController: UITableViewController { } - func dismissVC() { + @objc func dismissVC() { self.dismiss(animated: true) { self.primeVC?.popClosed() } @@ -69,7 +69,7 @@ class ShapesTableViewController: UITableViewController { override func tableView (_ _tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "testShapeCell") + let cell = UITableViewCell(style: UITableViewCell.CellStyle.default, reuseIdentifier: "testShapeCell") if let shapeData = shapeData { let testShape = shapeData.shapes[indexPath.row] cell.textLabel!.text = testShape.label @@ -77,7 +77,7 @@ class ShapesTableViewController: UITableViewController { cell.textLabel!.text = "Broken \(indexPath.row)" } if indexPath.row == currentSelection { - cell.accessoryType = UITableViewCellAccessoryType.checkmark + cell.accessoryType = UITableViewCell.AccessoryType.checkmark } return cell } diff --git a/Swift VectorBoolean/VectorBoolean/CGPathBridge/CGPath.swift b/Swift VectorBoolean/VectorBoolean/CGPathBridge/CGPath.swift index 7d6e3e3..50b584b 100644 --- a/Swift VectorBoolean/VectorBoolean/CGPathBridge/CGPath.swift +++ b/Swift VectorBoolean/VectorBoolean/CGPathBridge/CGPath.swift @@ -13,7 +13,7 @@ typealias MyPathApplier = @convention(block) (UnsafePointer) -> V // if you don't, you get "fatal error: can't unsafeBitCast between // types of different sizes" at runtime, on Mac OS X at least. -private func myPathApply(_ path: CGPath!, block: MyPathApplier) { +private func myPathApply(_ path: CGPath!, block: @escaping @convention(block) (UnsafePointer) -> Void) { let callback: @convention(c) (UnsafeMutableRawPointer, UnsafePointer) -> Void = { (info, element) in let block = unsafeBitCast(info, to: MyPathApplier.self) block(element) @@ -32,7 +32,7 @@ public enum PathElement { public extension CGPath { - func apply(_ fn: (PathElement) -> Void) { + func apply(_ fn: @escaping (PathElement) -> Void) { myPathApply(self) { element in let points = element.pointee.points switch (element.pointee.type) {