From 10d8ddb0f5e883220d5d199c0c1704853ec74e5c Mon Sep 17 00:00:00 2001 From: Paige Sun Date: Sun, 26 Nov 2017 01:45:44 -0500 Subject: [PATCH 1/2] Upgrade to the latest Swift 4 for Xcode 9.1. --- Boxify/Utilities.swift | 10 +++++----- Boxify/ViewController.swift | 2 +- README.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Boxify/Utilities.swift b/Boxify/Utilities.swift index cff38f6..51cfef0 100644 --- a/Boxify/Utilities.swift +++ b/Boxify/Utilities.swift @@ -15,7 +15,7 @@ extension UIImage { guard let ciImage = CIImage(image: self) else { return nil } - return UIImage(ciImage: ciImage.applyingFilter("CIColorInvert", withInputParameters: nil)) + return UIImage(ciImage: ciImage.applyingFilter("CIColorInvert")) } static func composeButtonImage(from thumbImage: UIImage, alpha: CGFloat = 1.0) -> UIImage { @@ -344,9 +344,9 @@ extension ARSCNView { let maxAngleInDeg = min(coneOpeningAngleInDegrees, 360) / 2 let maxAngle = ((maxAngleInDeg / 180) * Float.pi) - let points = features.points + let points = features.__points - for i in 0...features.count { + for i in 0...features.__count { let feature = points.advanced(by: Int(i)) let featurePos = SCNVector3(feature.pointee) @@ -416,13 +416,13 @@ extension ARSCNView { return nil } - let points = features.points + let points = features.__points // Determine the point from the whole point cloud which is closest to the hit test ray. var closestFeaturePoint = origin var minDistance = Float.greatestFiniteMagnitude - for i in 0...features.count { + for i in 0...features.__count { let feature = points.advanced(by: Int(i)) let featurePos = SCNVector3(feature.pointee) diff --git a/Boxify/ViewController.swift b/Boxify/ViewController.swift index b82cdc0..d71b547 100644 --- a/Boxify/ViewController.swift +++ b/Boxify/ViewController.swift @@ -174,7 +174,7 @@ class ViewController: UIViewController, ARSCNViewDelegate, UIGestureRecognizerDe super.viewWillAppear(animated) // Create a session configuration - let configuration = ARWorldTrackingSessionConfiguration() + let configuration = ARWorldTrackingConfiguration() configuration.planeDetection = .horizontal // Run the view's session diff --git a/README.md b/README.md index 6359542..ea6d599 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is an ARKit project that demonstrates drawing out a 3-dimensional box in the world, which can be rotated and resized from each of its faces. ### Requirements -1. XCode 9 (or newer) +1. XCode 9.1 (or newer) 2. [One of the following devices (or newer) running iOS 11 (or newer)](http://wccftech.com/heres-the-list-of-iphone-models-compatible-with-the-arkit-in-ios-11/): - The 2017 9.7-inch iPad - All three variants of the iPad Pro From 34814fe56ee353022a35fbddf52e63043516ca21 Mon Sep 17 00:00:00 2001 From: Paige Sun Date: Sun, 26 Nov 2017 01:45:55 -0500 Subject: [PATCH 2/2] Upgrade to the latest recommended settings to silence Xcode warning. --- Boxify.xcodeproj/project.pbxproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Boxify.xcodeproj/project.pbxproj b/Boxify.xcodeproj/project.pbxproj index 40fa94c..dbed104 100644 --- a/Boxify.xcodeproj/project.pbxproj +++ b/Boxify.xcodeproj/project.pbxproj @@ -109,7 +109,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0910; ORGANIZATIONNAME = "Alun Bestor"; TargetAttributes = { 9FFE39131EF1DE2500D26EB8 = { @@ -206,6 +206,8 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; @@ -261,6 +263,8 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES;