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

updates to Swift 4.2 and Xcode 10 #19

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Swift VectorBoolean.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion Swift VectorBoolean/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion Swift VectorBoolean/OptionsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class OptionsViewController: UIViewController {
}
}

func dismissVC() {
@objc func dismissVC() {
self.dismiss(animated: true) {
self.primeVC?.popClosed()
}
Expand Down
8 changes: 4 additions & 4 deletions Swift VectorBoolean/ShapesTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -44,7 +44,7 @@ class ShapesTableViewController: UITableViewController {
}


func dismissVC() {
@objc func dismissVC() {
self.dismiss(animated: true) {
self.primeVC?.popClosed()
}
Expand All @@ -69,15 +69,15 @@ 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
} else {
cell.textLabel!.text = "Broken \(indexPath.row)"
}
if indexPath.row == currentSelection {
cell.accessoryType = UITableViewCellAccessoryType.checkmark
cell.accessoryType = UITableViewCell.AccessoryType.checkmark
}
return cell
}
Expand Down
4 changes: 2 additions & 2 deletions Swift VectorBoolean/VectorBoolean/CGPathBridge/CGPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typealias MyPathApplier = @convention(block) (UnsafePointer<CGPathElement>) -> 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<CGPathElement>) -> Void) {
let callback: @convention(c) (UnsafeMutableRawPointer, UnsafePointer<CGPathElement>) -> Void = { (info, element) in
let block = unsafeBitCast(info, to: MyPathApplier.self)
block(element)
Expand All @@ -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) {
Expand Down