Skip to content

Commit

Permalink
Added Swift 5.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Cihan.Tek committed Apr 8, 2019
1 parent 38f6141 commit 047967c
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2
5.0
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
language: objective-c
osx_image: xcode10
osx_image: xcode10.2
cache: bundler
env:
global:
- FRAMEWORK_PROJECT=CTPanoramaView.xcodeproj
- FRAMEWORK_SCHEME=CTPanoramaView
- EXAMPLE_PROJECT="Example/Example.xcodeproj"
- EXAMPLE_SCHEME=Example
- SDK=iphonesimulator12.0
- SDK=iphonesimulator12.2
matrix:
- DESTINATION="OS=12.0,name=iPhone 8" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
- DESTINATION="OS=12.2,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
- gem install cocoapods --no-document --quiet
- gem install xcpretty --no-document --quiet
script:
- set -o pipefail
- xcodebuild -version
Expand Down
2 changes: 1 addition & 1 deletion CTPanoramaView.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CTPanoramaView"
s.version = "1.1"
s.version = "1.3"
s.summary = "Displays spherical or cylindrical panoramas and 360 photos with touch or motion based controls."
s.homepage = "https://github.com/scihant/CTPanoramaView"
s.screenshots = "https://cloud.githubusercontent.com/assets/3991481/23154113/ce5aa6b8-f814-11e6-9c97-4d91629733f8.gif", "https://cloud.githubusercontent.com/assets/3991481/23154919/d5f98476-f818-11e6-8c71-22011a027d96.jpg"
Expand Down
19 changes: 12 additions & 7 deletions CTPanoramaView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = scihant;
TargetAttributes = {
CF415AAA1E55C70F002A98ED = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = 38P3Q4228V;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
CF415AB31E55C70F002A98ED = {
Expand All @@ -176,10 +176,11 @@
};
buildConfigurationList = CF415AA51E55C70F002A98ED /* Build configuration list for PBXProject "CTPanoramaView" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = CF415AA11E55C70F002A98ED;
productRefGroup = CF415AAC1E55C70F002A98ED /* Products */;
Expand Down Expand Up @@ -242,6 +243,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -293,6 +295,8 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -303,6 +307,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -346,6 +351,8 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -370,8 +377,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -391,8 +397,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.CTPanoramaView;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
20 changes: 11 additions & 9 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = scihant;
TargetAttributes = {
CF415ADD1E55E314002A98ED = {
CreatedOnToolsVersion = 8.2.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = CF415AD91E55E314002A98ED /* Build configuration list for PBXProject "Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -283,6 +283,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -333,14 +334,16 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
CF415AEF1E55E314002A98ED /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -383,7 +386,8 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -398,8 +402,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -413,8 +416,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.scihant.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CTPanoramaView is a high-performance library that uses SceneKit to display compl
* 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
* v1.3 requires XCode 10.0 and Swift 5.0

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

Expand Down
4 changes: 2 additions & 2 deletions Source/CTPanoramaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private extension CMDeviceMotion {

result = quanternionMultiplier.vector(for: .portraitUpsideDown)

case .unknown, .portrait:
default:
let clockwiseQuanternion = GLKQuaternionMakeWithAngleAndAxis(-(.pi/2), 1, 0, 0)
let quanternionMultiplier = GLKQuaternionMultiply(clockwiseQuanternion, attitudeQuanternion)

Expand Down Expand Up @@ -394,7 +394,7 @@ private extension GLKQuaternion {
case .portraitUpsideDown:
return SCNVector4(x: -self.x, y: -self.y, z: self.z, w: self.w)

case .unknown, .portrait:
default:
return SCNVector4(x: self.x, y: self.y, z: self.z, w: self.w)
}
}
Expand Down

0 comments on commit 047967c

Please sign in to comment.