Skip to content

Commit

Permalink
Swift 4.2 and XCode 10 update
Browse files Browse the repository at this point in the history
  • Loading branch information
scihant committed Sep 20, 2018
1 parent cfe6eb9 commit 38f6141
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
4.2
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
language: objective-c
osx_image: xcode9
osx_image: xcode10
cache: bundler
env:
global:
- FRAMEWORK_PROJECT=CTPanoramaView.xcodeproj
- FRAMEWORK_SCHEME=CTPanoramaView
- EXAMPLE_PROJECT="Example/Example.xcodeproj"
- EXAMPLE_SCHEME=Example
- SDK=iphonesimulator11.0
- SDK=iphonesimulator12.0
matrix:
- DESTINATION="OS=11.0,name=iPhone 7" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
- DESTINATION="OS=9.3,name=iPhone 6" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=8.4,name=iPhone 4S" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=12.0,name=iPhone 8" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
- DESTINATION="OS=11.4,name=iPhone 6s" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=8.4,name=iPhone 5" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
before_install:
- gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
Expand Down
77 changes: 30 additions & 47 deletions CTPanoramaView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

/* Begin PBXBuildFile section */
CF415AB51E55C70F002A98ED /* CTPanoramaView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF415AAB1E55C70F002A98ED /* CTPanoramaView.framework */; };
CF415AC71E55C799002A98ED /* CTPanoramaViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF415AC51E55C799002A98ED /* CTPanoramaViewTests.swift */; };
CF415ACB1E55C7C0002A98ED /* CTPanoramaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF415AC91E55C7C0002A98ED /* CTPanoramaView.swift */; };
CF415ACC1E55C7C0002A98ED /* CTPieSliceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF415ACA1E55C7C0002A98ED /* CTPieSliceView.swift */; };
CF415AD41E55E02F002A98ED /* CTPanoramaView.h in Headers */ = {isa = PBXBuildFile; fileRef = CF415AD31E55E02F002A98ED /* CTPanoramaView.h */; settings = {ATTRIBUTES = (Public, ); }; };
CFED887821536EA200F9488A /* CTPanoramaViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFED887621536EA200F9488A /* CTPanoramaViewTests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -27,12 +27,12 @@
/* Begin PBXFileReference section */
CF415AAB1E55C70F002A98ED /* CTPanoramaView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CTPanoramaView.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CF415AB41E55C70F002A98ED /* CTPanoramaViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CTPanoramaViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
CF415AC51E55C799002A98ED /* CTPanoramaViewTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CTPanoramaViewTests.swift; path = Tests/CTPanoramaViewTests.swift; sourceTree = SOURCE_ROOT; };
CF415AC61E55C799002A98ED /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Tests/Info.plist; sourceTree = SOURCE_ROOT; };
CF415AC91E55C7C0002A98ED /* CTPanoramaView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CTPanoramaView.swift; path = Source/CTPanoramaView.swift; sourceTree = SOURCE_ROOT; };
CF415ACA1E55C7C0002A98ED /* CTPieSliceView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CTPieSliceView.swift; path = Source/CTPieSliceView.swift; sourceTree = SOURCE_ROOT; };
CF415ACF1E55C807002A98ED /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Source/Info.plist; sourceTree = SOURCE_ROOT; };
CF415AD31E55E02F002A98ED /* CTPanoramaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTPanoramaView.h; path = Source/CTPanoramaView.h; sourceTree = SOURCE_ROOT; };
CF415ACF1E55C807002A98ED /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Supporting Files/Info.plist"; sourceTree = SOURCE_ROOT; };
CF415AD31E55E02F002A98ED /* CTPanoramaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CTPanoramaView.h; path = "Supporting Files/CTPanoramaView.h"; sourceTree = SOURCE_ROOT; };
CFED887621536EA200F9488A /* CTPanoramaViewTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CTPanoramaViewTests.swift; sourceTree = "<group>"; };
CFED887721536EA200F9488A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -58,8 +58,8 @@
isa = PBXGroup;
children = (
CF415AD21E55DEE4002A98ED /* Source */,
CF415AAD1E55C70F002A98ED /* Supporting Files */,
CF415AB81E55C70F002A98ED /* Tests */,
CFED887421536E1C00F9488A /* Supporting Files */,
CFED887521536EA200F9488A /* Tests */,
CF415AAC1E55C70F002A98ED /* Products */,
);
sourceTree = "<group>";
Expand All @@ -73,33 +73,31 @@
name = Products;
sourceTree = "<group>";
};
CF415AAD1E55C70F002A98ED /* Supporting Files */ = {
CF415AD21E55DEE4002A98ED /* Source */ = {
isa = PBXGroup;
children = (
CF415AD31E55E02F002A98ED /* CTPanoramaView.h */,
CF415ACF1E55C807002A98ED /* Info.plist */,
CF415AC91E55C7C0002A98ED /* CTPanoramaView.swift */,
CF415ACA1E55C7C0002A98ED /* CTPieSliceView.swift */,
);
name = "Supporting Files";
path = CTPanoramaView;
name = Source;
sourceTree = "<group>";
};
CF415AB81E55C70F002A98ED /* Tests */ = {
CFED887421536E1C00F9488A /* Supporting Files */ = {
isa = PBXGroup;
children = (
CF415AC51E55C799002A98ED /* CTPanoramaViewTests.swift */,
CF415AC61E55C799002A98ED /* Info.plist */,
CF415AD31E55E02F002A98ED /* CTPanoramaView.h */,
CF415ACF1E55C807002A98ED /* Info.plist */,
);
name = Tests;
path = CTPanoramaViewTests;
path = "Supporting Files";
sourceTree = "<group>";
};
CF415AD21E55DEE4002A98ED /* Source */ = {
CFED887521536EA200F9488A /* Tests */ = {
isa = PBXGroup;
children = (
CF415AC91E55C7C0002A98ED /* CTPanoramaView.swift */,
CF415ACA1E55C7C0002A98ED /* CTPieSliceView.swift */,
CFED887621536EA200F9488A /* CTPanoramaViewTests.swift */,
CFED887721536EA200F9488A /* Info.plist */,
);
name = Source;
path = Tests;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand All @@ -124,7 +122,6 @@
CF415AA71E55C70F002A98ED /* Frameworks */,
CF415AA81E55C70F002A98ED /* Headers */,
CF415AA91E55C70F002A98ED /* Resources */,
CE460E572095FFB7007AA570 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -166,13 +163,13 @@
CF415AAA1E55C70F002A98ED = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 38P3Q4228V;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
CF415AB31E55C70F002A98ED = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = FH52365GTQ;
LastSwiftMigration = 0820;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -212,22 +209,6 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
CE460E572095FFB7007AA570 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
CF415AA61E55C70F002A98ED /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand All @@ -242,7 +223,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CF415AC71E55C799002A98ED /* CTPanoramaViewTests.swift in Sources */,
CFED887821536EA200F9488A /* CTPanoramaViewTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -382,15 +363,15 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Source/Info.plist;
INFOPLIST_FILE = "Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.CTPanoramaView;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -404,14 +385,14 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Source/Info.plist;
INFOPLIST_FILE = "Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.CTPanoramaView;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -426,7 +407,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.CTPanoramaViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -440,7 +422,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.CTPanoramaViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -414,7 +414,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Example/Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CTPanoramaView is a high-performance library that uses SceneKit to display compl
* iOS 8.0+
* v1.0 requires Xcode 8.0 and Swift 3.0
* v1.1 requires XCode 9.0 and Swift 4.0
* v1.2 requires XCode 10.0 and Swift 4.2

CTPanoramaView can be used both from Objective-C and Swift code.

Expand Down
20 changes: 10 additions & 10 deletions Source/CTPanoramaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import ImageIO
@objc public class CTPanoramaView: UIView {

// MARK: Public properties

@objc public var compass: CTPanoramaCompass?
@objc public var movementHandler: ((_ rotationAngle: CGFloat, _ fieldOfViewAngle: CGFloat) -> ())?
@objc public var movementHandler: ((_ rotationAngle: CGFloat, _ fieldOfViewAngle: CGFloat) -> Void)?
@objc public var panSpeed = CGPoint(x: 0.005, y: 0.005)
@objc public var startAngle: Float = 0

Expand Down Expand Up @@ -59,7 +59,7 @@ import ImageIO
resetCameraAngles()
}
}

// MARK: Private properties

private let radius: CGFloat = 10
Expand Down Expand Up @@ -88,7 +88,7 @@ import ImageIO
}()

private var startScale = 0.0

private var xFov: CGFloat {
return yFov * self.bounds.width / self.bounds.height
}
Expand Down Expand Up @@ -203,7 +203,7 @@ import ImageIO
if method == .touch {
let panGestureRec = UIPanGestureRecognizer(target: self, action: #selector(handlePan(panRec:)))
sceneView.addGestureRecognizer(panGestureRec)

let pinchRec = UIPinchGestureRecognizer(target: self, action: #selector(handlePinch(pinchRec:)))
sceneView.addGestureRecognizer(pinchRec)

Expand Down Expand Up @@ -282,12 +282,12 @@ import ImageIO
reportMovement(CGFloat(-cameraNode.eulerAngles.y), xFov.toRadians())
}
}

@objc func handlePinch(pinchRec: UIPinchGestureRecognizer) {
if pinchRec.numberOfTouches != 2 {
return
}

let zoom = Double(pinchRec.scale)
switch pinchRec.state {
case .began:
Expand All @@ -311,7 +311,7 @@ import ImageIO
}
}

fileprivate extension CMDeviceMotion {
private extension CMDeviceMotion {

func orientation() -> SCNVector4 {

Expand Down Expand Up @@ -356,7 +356,7 @@ fileprivate extension CMDeviceMotion {
}
}

fileprivate extension UIView {
private extension UIView {
func add(view: UIView) {
view.translatesAutoresizingMaskIntoConstraints = false
addSubview(view)
Expand All @@ -368,7 +368,7 @@ fileprivate extension UIView {
}
}

fileprivate extension FloatingPoint {
private extension FloatingPoint {
func toDegrees() -> Self {
return self * 180 / .pi
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Source/Info.plist → Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion Tests/CTPanoramaViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CTPanoramaViewTests: XCTestCase {
XCTAssert(overlayView.superview == nil)
}

func createImage(size: CGSize, scale: CGFloat = 1, orientation: UIImageOrientation = .up) -> UIImage {
func createImage(size: CGSize, scale: CGFloat = 1, orientation: UIImage.Orientation = .up) -> UIImage {
UIGraphicsBeginImageContextWithOptions(size, true, scale)
defer {UIGraphicsEndImageContext()}

Expand Down

0 comments on commit 38f6141

Please sign in to comment.