Skip to content

Commit ad377ca

Browse files
authored
Merge pull request #26 from prolificinteractive/chore/swift-4.2-migration
Swift 4.2 Update
2 parents 3cb8bd7 + fb16404 commit ad377ca

File tree

14 files changed

+32
-67
lines changed

14 files changed

+32
-67
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0
1+
4.2

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
language: objective-c
2-
osx_image: xcode9
2+
osx_image: xcode10
33
podfile: Example/Podfile
44

55
before_install:
66
- gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet
77

88
script:
9-
- set -o pipefail && xcodebuild test -project Marker/Marker.xcodeproj -scheme Marker-iOS -destination 'name=iPhone 7,OS=11.0' | xcpretty
9+
- set -o pipefail && xcodebuild test -project Marker/Marker.xcodeproj -scheme Marker-iOS -destination 'name=iPhone 8,OS=12.0' | xcpretty
1010
- set -o pipefail && xcodebuild test -project Marker/Marker.xcodeproj -scheme Marker-macOS -destination 'arch=x86_64' | xcpretty
1111
- set -o pipefail && xcodebuild test -project Marker/Marker.xcodeproj -scheme Marker-tvOS -destination 'name=Apple TV 1080p,OS=11.0' | xcpretty
1212
- pod lib lint

Example/Marker-Example-iOS/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2222
// MARK: - Instance functions
2323

2424
func application(_ application: UIApplication,
25-
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
25+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
2626
if let viewController = window?.rootViewController as? ViewController {
2727
viewController.theme = theme
2828
}

Example/Marker-Example-iOS/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ internal final class ViewController: UIViewController {
7777
private func registerForNotifications() {
7878
NotificationCenter.default.addObserver(self,
7979
selector: #selector(ViewController.updateViews),
80-
name: NSNotification.Name.UIContentSizeCategoryDidChange,
80+
name: UIContentSizeCategory.didChangeNotification,
8181
object: nil)
8282
NotificationCenter.default.addObserver(self,
8383
selector: #selector(ViewController.updateViews),
84-
name: NSNotification.Name(rawValue: AppTheme.Constants.fontThemeDidChangeNotification),
84+
name: Notification.Name(rawValue: AppTheme.Constants.fontThemeDidChangeNotification),
8585
object: nil)
8686
}
8787

Example/Marker-Example.xcodeproj/project.pbxproj

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
271C85D21ED4E40800F8BBBB /* Frameworks */,
183183
271C85D31ED4E40800F8BBBB /* Resources */,
184184
FAF73D195B963F0D4B5861A5 /* [CP] Embed Pods Frameworks */,
185-
2C97776FB52214BDCF7F7BD2 /* [CP] Copy Pods Resources */,
186185
);
187186
buildRules = (
188187
);
@@ -202,7 +201,6 @@
202201
272D862D1ED62E9C00CE29EB /* Frameworks */,
203202
272D862E1ED62E9C00CE29EB /* Resources */,
204203
40B7CC52E028A1EB1F9E75FE /* [CP] Embed Pods Frameworks */,
205-
99D7069AFB3C7D29D4F26C07 /* [CP] Copy Pods Resources */,
206204
);
207205
buildRules = (
208206
);
@@ -220,7 +218,7 @@
220218
isa = PBXProject;
221219
attributes = {
222220
LastSwiftUpdateCheck = 0830;
223-
LastUpgradeCheck = 0830;
221+
LastUpgradeCheck = 1000;
224222
TargetAttributes = {
225223
271C85D41ED4E40800F8BBBB = {
226224
CreatedOnToolsVersion = 8.3.2;
@@ -313,21 +311,6 @@
313311
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";
314312
showEnvVarsInLog = 0;
315313
};
316-
2C97776FB52214BDCF7F7BD2 /* [CP] Copy Pods Resources */ = {
317-
isa = PBXShellScriptBuildPhase;
318-
buildActionMask = 2147483647;
319-
files = (
320-
);
321-
inputPaths = (
322-
);
323-
name = "[CP] Copy Pods Resources";
324-
outputPaths = (
325-
);
326-
runOnlyForDeploymentPostprocessing = 0;
327-
shellPath = /bin/sh;
328-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Marker-Example-iOS/Pods-Marker-Example-iOS-resources.sh\"\n";
329-
showEnvVarsInLog = 0;
330-
};
331314
40B7CC52E028A1EB1F9E75FE /* [CP] Embed Pods Frameworks */ = {
332315
isa = PBXShellScriptBuildPhase;
333316
buildActionMask = 2147483647;
@@ -346,21 +329,6 @@
346329
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Marker-Example-macOS/Pods-Marker-Example-macOS-frameworks.sh\"\n";
347330
showEnvVarsInLog = 0;
348331
};
349-
99D7069AFB3C7D29D4F26C07 /* [CP] Copy Pods Resources */ = {
350-
isa = PBXShellScriptBuildPhase;
351-
buildActionMask = 2147483647;
352-
files = (
353-
);
354-
inputPaths = (
355-
);
356-
name = "[CP] Copy Pods Resources";
357-
outputPaths = (
358-
);
359-
runOnlyForDeploymentPostprocessing = 0;
360-
shellPath = /bin/sh;
361-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Marker-Example-macOS/Pods-Marker-Example-macOS-resources.sh\"\n";
362-
showEnvVarsInLog = 0;
363-
};
364332
FAF73D195B963F0D4B5861A5 /* [CP] Embed Pods Frameworks */ = {
365333
isa = PBXShellScriptBuildPhase;
366334
buildActionMask = 2147483647;
@@ -509,7 +477,7 @@
509477
SDKROOT = iphoneos;
510478
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
511479
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
512-
SWIFT_VERSION = 4.0;
480+
SWIFT_VERSION = 4.2;
513481
TARGETED_DEVICE_FAMILY = 1;
514482
};
515483
name = Debug;
@@ -560,7 +528,7 @@
560528
PRODUCT_NAME = "$(TARGET_NAME)";
561529
SDKROOT = iphoneos;
562530
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
563-
SWIFT_VERSION = 4.0;
531+
SWIFT_VERSION = 4.2;
564532
TARGETED_DEVICE_FAMILY = 1;
565533
VALIDATE_PRODUCT = YES;
566534
};

Example/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
PODS:
2-
- Marker (1.1.0)
2+
- Marker (1.2.0)
33

44
DEPENDENCIES:
55
- Marker (from `../`)
66

77
EXTERNAL SOURCES:
88
Marker:
9-
:path: ../
9+
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
Marker: ef3ead037c66a1340eec2fd9f79b27cb36dcbec3
12+
Marker: 78178ba8e5f702b64227c4371ed5b9533984d0cd
1313

1414
PODFILE CHECKSUM: 2d22b0ce73bebf9f2dee7cbf15b441cc137adc5e
1515

16-
COCOAPODS: 1.3.1
16+
COCOAPODS: 1.5.3

Example/Theme/MarkerExampleFontTheme.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal struct MarkerExampleFontTheme: FontTheme {
2828
emFont: emFont,
2929
strongFont: strongFont,
3030
characterSpacing: characterSpacing,
31-
strikethroughStyle: .styleThick,
31+
strikethroughStyle: .thick,
3232
strikethroughColor: .white,
3333
textTransform: .uppercased)
3434
}

Marker.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = "Marker"
11-
s.version = "1.1.0"
11+
s.version = "1.2.0"
1212
s.summary = "A light wrapper around NSAttributedString."
1313
s.description = <<-DESC
1414
TODO: Add long description of the pod here.

Marker/Marker.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@
909909
PRODUCT_NAME = Marker;
910910
SKIP_INSTALL = YES;
911911
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
912-
SWIFT_VERSION = 4.0;
912+
SWIFT_VERSION = 4.2;
913913
};
914914
name = Debug;
915915
};
@@ -932,7 +932,7 @@
932932
PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.Marker;
933933
PRODUCT_NAME = Marker;
934934
SKIP_INSTALL = YES;
935-
SWIFT_VERSION = 4.0;
935+
SWIFT_VERSION = 4.2;
936936
};
937937
name = Release;
938938
};

Marker/Marker/TextAttributes.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414

1515
#if swift(>=4.0)
1616
/// Text attributes.
17-
public typealias TextAttributes = [NSAttributedStringKey: Any]
17+
public typealias TextAttributes = [NSAttributedString.Key: Any]
1818

1919
struct AttributedStringKey {
2020

21-
static let font = NSAttributedStringKey.font
22-
static let foregroundColor = NSAttributedStringKey.foregroundColor
23-
static let kern = NSAttributedStringKey.kern
24-
static let link = NSAttributedStringKey.link
25-
static let paragraphStyle = NSAttributedStringKey.paragraphStyle
26-
static let strikethroughStyle = NSAttributedStringKey.strikethroughStyle
27-
static let strikethroughColor = NSAttributedStringKey.strikethroughColor
28-
static let underlineStyle = NSAttributedStringKey.underlineStyle
29-
static let underlineColor = NSAttributedStringKey.underlineColor
21+
static let font = NSAttributedString.Key.font
22+
static let foregroundColor = NSAttributedString.Key.foregroundColor
23+
static let kern = NSAttributedString.Key.kern
24+
static let link = NSAttributedString.Key.link
25+
static let paragraphStyle = NSAttributedString.Key.paragraphStyle
26+
static let strikethroughStyle = NSAttributedString.Key.strikethroughStyle
27+
static let strikethroughColor = NSAttributedString.Key.strikethroughColor
28+
static let underlineStyle = NSAttributedString.Key.underlineStyle
29+
static let underlineColor = NSAttributedString.Key.underlineColor
3030

3131
}
3232
#else

0 commit comments

Comments
 (0)