Skip to content

Commit ac9cca7

Browse files
authored
Swift 3.2/4 support (#41)
Adds support for Swift 3.2/4 with additional instructions on supporting Swift4 (with the exclusion of Mixpanel while we await a Swift4 release)
1 parent 7ca1033 commit ac9cca7

File tree

11 files changed

+117
-42
lines changed

11 files changed

+117
-42
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
3.2

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55

66
language: objective-c
7-
osx_image: xcode8.1
7+
osx_image: xcode9
88
cache: cocoapods
99
podfile: Podfile
1010
before_install:

Podfile.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
PODS:
2-
- AdobeMobileSDK (4.13.0):
3-
- AdobeMobileSDK/iOS (= 4.13.0)
4-
- AdobeMobileSDK/iOS (4.13.0)
5-
- Mixpanel-swift (2.1.3)
6-
- mParticle-Apple-SDK (6.11.1):
7-
- mParticle-Apple-SDK/mParticle (= 6.11.1)
8-
- mParticle-Apple-SDK/mParticle (6.11.1)
9-
- Simcoe/Adobe (1.0.0):
2+
- AdobeMobileSDK (4.13.8):
3+
- AdobeMobileSDK/iOS (= 4.13.8)
4+
- AdobeMobileSDK/iOS (4.13.8)
5+
- Mixpanel-swift (2.2.1)
6+
- mParticle-Apple-SDK (6.15.10):
7+
- mParticle-Apple-SDK/mParticle (= 6.15.10)
8+
- mParticle-Apple-SDK/mParticle (6.15.10)
9+
- Simcoe/Adobe (1.2.0):
1010
- AdobeMobileSDK (~> 4.13)
1111
- Simcoe/Core
12-
- Simcoe/Core (1.0.0)
13-
- Simcoe/Mixpanel (1.0.0):
14-
- Mixpanel-swift (~> 2.1.3)
12+
- Simcoe/Core (1.2.0)
13+
- Simcoe/Mixpanel (1.2.0):
14+
- Mixpanel-swift (~> 2.2.0)
1515
- Simcoe/Core
16-
- Simcoe/mParticle (1.0.0):
16+
- Simcoe/mParticle (1.2.0):
1717
- mParticle-Apple-SDK (~> 6)
1818
- Simcoe/Core
1919

2020
DEPENDENCIES:
2121
- AdobeMobileSDK (~> 4.13)
22-
- Mixpanel-swift (~> 2.1.3)
22+
- Mixpanel-swift (~> 2.2.0)
2323
- mParticle-Apple-SDK (~> 6)
2424
- Simcoe/Adobe (from `./`)
2525
- Simcoe/Mixpanel (from `./`)
2626
- Simcoe/mParticle (from `./`)
2727

2828
EXTERNAL SOURCES:
2929
Simcoe:
30-
:path: "./"
30+
:path: ./
3131

3232
SPEC CHECKSUMS:
33-
AdobeMobileSDK: 52c3fbf43b5b054132393b1486ecbefca0ba01db
34-
Mixpanel-swift: a50fe20def8fc2ea0f2c912772ad835bd8524dae
35-
mParticle-Apple-SDK: 8c7dfc195459870aa33be634f006342cb37d6a24
36-
Simcoe: 3e77a2ef7f0a28b3184cd823cae9682613760d75
33+
AdobeMobileSDK: de79920972a9abcf4e27b141fb79d0262fe9ee11
34+
Mixpanel-swift: d0374c33e38a7f184203eef1c8eae64be54986ed
35+
mParticle-Apple-SDK: 7be8af83582e0c2c99e78075142eb7be9e24aab3
36+
Simcoe: d29afc62c1f5cbfe8d90522d2a46331b71c9a502
3737

3838
PODFILE CHECKSUM: 3168a08aa3eb292250204b2bc967159b719878a0
3939

40-
COCOAPODS: 1.1.1
40+
COCOAPODS: 1.3.1

Simcoe.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
3535

3636
adobe = { :name => "Adobe", :dependency => "AdobeMobileSDK", :version => '~> 4.13' }
3737
mParticle = { :name => "mParticle", :dependency => "mParticle-Apple-SDK", :version => '~> 6' }
38-
mixpanel = { :name => "Mixpanel", :dependency => "Mixpanel-swift", :version => '~> 2.1.3' }
38+
mixpanel = { :name => "Mixpanel", :dependency => "Mixpanel-swift", :version => '~> 2.2.0' }
3939

4040
all_specs = [adobe, mParticle, mixpanel]
4141

Simcoe.xcodeproj/project.pbxproj

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,16 +427,16 @@
427427
isa = PBXProject;
428428
attributes = {
429429
LastSwiftUpdateCheck = 0720;
430-
LastUpgradeCheck = 0810;
430+
LastUpgradeCheck = 0900;
431431
ORGANIZATIONNAME = "Prolific Interactive";
432432
TargetAttributes = {
433433
72897FDC1C79E25800393482 = {
434434
CreatedOnToolsVersion = 7.2;
435-
LastSwiftMigration = 0800;
435+
LastSwiftMigration = 0900;
436436
};
437437
F902ED111C68FA07007975F5 = {
438438
CreatedOnToolsVersion = 7.2;
439-
LastSwiftMigration = 0800;
439+
LastSwiftMigration = 0900;
440440
};
441441
};
442442
};
@@ -482,13 +482,16 @@
482482
files = (
483483
);
484484
inputPaths = (
485+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
486+
"${PODS_ROOT}/Manifest.lock",
485487
);
486488
name = "[CP] Check Pods Manifest.lock";
487489
outputPaths = (
490+
"$(DERIVED_FILE_DIR)/Pods-Simcoe-checkManifestLockResult.txt",
488491
);
489492
runOnlyForDeploymentPostprocessing = 0;
490493
shellPath = /bin/sh;
491-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
494+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
492495
showEnvVarsInLog = 0;
493496
};
494497
3BD8A183EE1390D19A959186 /* [CP] Check Pods Manifest.lock */ = {
@@ -497,13 +500,16 @@
497500
files = (
498501
);
499502
inputPaths = (
503+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
504+
"${PODS_ROOT}/Manifest.lock",
500505
);
501506
name = "[CP] Check Pods Manifest.lock";
502507
outputPaths = (
508+
"$(DERIVED_FILE_DIR)/Pods-Simcoe-SimcoeTests-checkManifestLockResult.txt",
503509
);
504510
runOnlyForDeploymentPostprocessing = 0;
505511
shellPath = /bin/sh;
506-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
512+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
507513
showEnvVarsInLog = 0;
508514
};
509515
92508C4DD7CFB48C39292C10 /* [CP] Copy Pods Resources */ = {
@@ -542,9 +548,18 @@
542548
files = (
543549
);
544550
inputPaths = (
551+
"${SRCROOT}/Pods/Target Support Files/Pods-Simcoe-SimcoeTests/Pods-Simcoe-SimcoeTests-frameworks.sh",
552+
"${BUILT_PRODUCTS_DIR}/AdobeMobileSDK/AdobeMobileSDK.framework",
553+
"${BUILT_PRODUCTS_DIR}/Mixpanel-swift/Mixpanel.framework",
554+
"${BUILT_PRODUCTS_DIR}/Simcoe/Simcoe.framework",
555+
"${BUILT_PRODUCTS_DIR}/mParticle-Apple-SDK/mParticle_Apple_SDK.framework",
545556
);
546557
name = "[CP] Embed Pods Frameworks";
547558
outputPaths = (
559+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AdobeMobileSDK.framework",
560+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mixpanel.framework",
561+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Simcoe.framework",
562+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/mParticle_Apple_SDK.framework",
548563
);
549564
runOnlyForDeploymentPostprocessing = 0;
550565
shellPath = /bin/sh;
@@ -647,6 +662,7 @@
647662
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
648663
PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.SimcoeTests;
649664
PRODUCT_NAME = "$(TARGET_NAME)";
665+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
650666
SWIFT_VERSION = 3.0;
651667
};
652668
name = Debug;
@@ -659,6 +675,7 @@
659675
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
660676
PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.SimcoeTests;
661677
PRODUCT_NAME = "$(TARGET_NAME)";
678+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
662679
SWIFT_VERSION = 3.0;
663680
};
664681
name = Release;
@@ -672,14 +689,20 @@
672689
CLANG_CXX_LIBRARY = "libc++";
673690
CLANG_ENABLE_MODULES = YES;
674691
CLANG_ENABLE_OBJC_ARC = YES;
692+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
675693
CLANG_WARN_BOOL_CONVERSION = YES;
694+
CLANG_WARN_COMMA = YES;
676695
CLANG_WARN_CONSTANT_CONVERSION = YES;
677696
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
678697
CLANG_WARN_EMPTY_BODY = YES;
679698
CLANG_WARN_ENUM_CONVERSION = YES;
680699
CLANG_WARN_INFINITE_RECURSION = YES;
681700
CLANG_WARN_INT_CONVERSION = YES;
701+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
702+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
682703
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
704+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
705+
CLANG_WARN_STRICT_PROTOTYPES = YES;
683706
CLANG_WARN_SUSPICIOUS_MOVE = YES;
684707
CLANG_WARN_UNREACHABLE_CODE = YES;
685708
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -724,14 +747,20 @@
724747
CLANG_CXX_LIBRARY = "libc++";
725748
CLANG_ENABLE_MODULES = YES;
726749
CLANG_ENABLE_OBJC_ARC = YES;
750+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
727751
CLANG_WARN_BOOL_CONVERSION = YES;
752+
CLANG_WARN_COMMA = YES;
728753
CLANG_WARN_CONSTANT_CONVERSION = YES;
729754
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
730755
CLANG_WARN_EMPTY_BODY = YES;
731756
CLANG_WARN_ENUM_CONVERSION = YES;
732757
CLANG_WARN_INFINITE_RECURSION = YES;
733758
CLANG_WARN_INT_CONVERSION = YES;
759+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
760+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
734761
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
762+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
763+
CLANG_WARN_STRICT_PROTOTYPES = YES;
735764
CLANG_WARN_SUSPICIOUS_MOVE = YES;
736765
CLANG_WARN_UNREACHABLE_CODE = YES;
737766
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -781,6 +810,7 @@
781810
SKIP_INSTALL = YES;
782811
SWIFT_OBJC_BRIDGING_HEADER = "";
783812
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
813+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
784814
SWIFT_VERSION = 3.0;
785815
};
786816
name = Debug;
@@ -804,6 +834,7 @@
804834
PRODUCT_NAME = Simcoe;
805835
SKIP_INSTALL = YES;
806836
SWIFT_OBJC_BRIDGING_HEADER = "";
837+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
807838
SWIFT_VERSION = 3.0;
808839
};
809840
name = Release;

Simcoe.xcodeproj/xcshareddata/xcschemes/Simcoe.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0810"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference
@@ -55,6 +56,7 @@
5556
buildConfiguration = "Debug"
5657
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5758
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59+
language = ""
5860
launchStyle = "0"
5961
useCustomWorkingDirectory = "NO"
6062
ignoresPersistentStateOnLaunch = "NO"

Simcoe.xcodeproj/xcshareddata/xcschemes/SimcoeTests.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0810"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -10,6 +10,7 @@
1010
buildConfiguration = "Debug"
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
language = ""
1314
shouldUseLaunchSchemeArgsEnv = "YES">
1415
<Testables>
1516
<TestableReference
@@ -39,6 +40,7 @@
3940
buildConfiguration = "Debug"
4041
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4142
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
language = ""
4244
launchStyle = "0"
4345
useCustomWorkingDirectory = "NO"
4446
ignoresPersistentStateOnLaunch = "NO"

SimcoeTests/mParticle/MPEventTests.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class MPEventTests: XCTestCase {
2929
}
3030

3131
XCTAssertNil(eventError,
32-
"Expected error to be nil; got \(eventError)")
32+
"Expected error to be nil; got \(String(describing: eventError))")
3333
XCTAssertNotNil(event,
34-
"Expected event to not be nil; got nil")
34+
"Expected event to not be nil; got nil")
3535
}
3636

3737
func test_that_name_error_thrown_when_missing() {
@@ -51,9 +51,9 @@ class MPEventTests: XCTestCase {
5151
}
5252

5353
XCTAssertNil(event,
54-
"Expected event to fail initialization and return nil; got \(event).")
54+
"Expected event to fail initialization and return nil; got \(String(describing: event)).")
5555
XCTAssertEqual(expected, eventError as? MPEventGenerationError,
56-
"Expected result = \(expected); got \(eventError)")
56+
"Expected result = \(expected); got \(String(describing: eventError))")
5757
}
5858

5959
func test_that_type_error_thrown_when_missing() {
@@ -73,9 +73,9 @@ class MPEventTests: XCTestCase {
7373
}
7474

7575
XCTAssertNil(event,
76-
"Expected event to be nil; got \(event)")
76+
"Expected event to be nil; got \(String(describing: event))")
7777
XCTAssertEqual(expected, eventError as? MPEventGenerationError,
78-
"Expected result = \(expected); got \(eventError)")
78+
"Expected result = \(expected); got \(String(describing: eventError))")
7979
}
8080

8181
func test_that_init_error_thrown_when_bad_data_input() {
@@ -95,11 +95,11 @@ class MPEventTests: XCTestCase {
9595
XCTAssertNil(event,
9696
"Expected result = event is nil; got not-nil.")
9797
XCTAssertEqual(expected, eventError,
98-
"Expected result = \(expected); got \(eventError)")
98+
"Expected result = \(expected); got \(String(describing: eventError))")
9999
}
100100

101101
func test_that_MPEvent_has_type() {
102-
let type = MPEventType.media
102+
let type = MPEventType.social
103103

104104
let data = MPEvent.eventData(type: type, name: "Event Type")
105105
let result = try! MPEvent.toEvent(usingData: data)
@@ -125,7 +125,7 @@ class MPEventTests: XCTestCase {
125125
let result = try! MPEvent.toEvent(usingData: data)
126126

127127
XCTAssertEqual(category, result.category,
128-
"Expected result = \(category); got \(result.category)")
128+
"Expected result = \(category); got \(String(describing: result.category))")
129129
}
130130

131131
func test_that_MPEvent_has_duration() {
@@ -135,7 +135,7 @@ class MPEventTests: XCTestCase {
135135
let result = try! MPEvent.toEvent(usingData: data)
136136

137137
XCTAssertEqual(duration, result.duration as! Float,
138-
"Expected result = \(duration); got \(result.duration)")
138+
"Expected result = \(duration); got \(String(describing: result.duration))")
139139
}
140140

141141
func test_that_MPEvent_has_customFlags() {

0 commit comments

Comments
 (0)