Skip to content

Commit 8477f72

Browse files
authored
Merge pull request #24 from eddiekaiger/swift-4.1
Swift 4.1 Warning Fix
2 parents 666a070 + 1854a09 commit 8477f72

File tree

9 files changed

+30
-20
lines changed

9 files changed

+30
-20
lines changed

SwiftyAttributes.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Pod::Spec.new do |s|
33

44
s.name = "SwiftyAttributes"
5-
s.version = "4.1.0"
5+
s.version = "4.1.1"
66
s.summary = "A Swifty API for attributed strings."
77

88
s.description = <<-DESC
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
1414
s.homepage = "https://github.com/eddiekaiger/SwiftyAttributes"
1515
s.license = { :type => "MIT", :file => "LICENSE" }
1616
s.author = { "Eddie Kaiger" => "eddiekaiger@gmail.com" }
17-
s.source = { :git => "https://github.com/eddiekaiger/SwiftyAttributes.git", :tag => "v4.1.0" }
17+
s.source = { :git => "https://github.com/eddiekaiger/SwiftyAttributes.git", :tag => "v4.1.1" }
1818

1919
s.source_files = "SwiftyAttributes/Sources/common/*.swift"
2020
s.osx.source_files = "SwiftyAttributes/Sources/macOS/*.swift"

SwiftyAttributes.xcodeproj/project.pbxproj

+7-3
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355
isa = PBXProject;
356356
attributes = {
357357
LastSwiftUpdateCheck = 0810;
358-
LastUpgradeCheck = 0900;
358+
LastUpgradeCheck = 0930;
359359
ORGANIZATIONNAME = "Eddie Kaiger";
360360
TargetAttributes = {
361361
C03658F61DC859D80051F06D = {
@@ -691,13 +691,15 @@
691691
CLANG_WARN_BOOL_CONVERSION = YES;
692692
CLANG_WARN_COMMA = YES;
693693
CLANG_WARN_CONSTANT_CONVERSION = YES;
694+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
694695
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
695696
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
696697
CLANG_WARN_EMPTY_BODY = YES;
697698
CLANG_WARN_ENUM_CONVERSION = YES;
698699
CLANG_WARN_INFINITE_RECURSION = YES;
699700
CLANG_WARN_INT_CONVERSION = YES;
700701
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
702+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
701703
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
702704
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
703705
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -733,7 +735,7 @@
733735
SUPPORTED_PLATFORMS = "watchsimulator watchos appletvos appletvsimulator iphoneos iphonesimulator macosx";
734736
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
735737
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
736-
SWIFT_VERSION = 3.0;
738+
SWIFT_VERSION = 4.0;
737739
TARGETED_DEVICE_FAMILY = "1,2,3,4";
738740
TVOS_DEPLOYMENT_TARGET = 9.0;
739741
VERSIONING_SYSTEM = "apple-generic";
@@ -755,13 +757,15 @@
755757
CLANG_WARN_BOOL_CONVERSION = YES;
756758
CLANG_WARN_COMMA = YES;
757759
CLANG_WARN_CONSTANT_CONVERSION = YES;
760+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
758761
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
759762
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
760763
CLANG_WARN_EMPTY_BODY = YES;
761764
CLANG_WARN_ENUM_CONVERSION = YES;
762765
CLANG_WARN_INFINITE_RECURSION = YES;
763766
CLANG_WARN_INT_CONVERSION = YES;
764767
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
768+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
765769
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
766770
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
767771
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -789,7 +793,7 @@
789793
PRODUCT_BUNDLE_PACKAGE_TYPE = BNDL;
790794
SUPPORTED_PLATFORMS = "watchsimulator watchos appletvos appletvsimulator iphoneos iphonesimulator macosx";
791795
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
792-
SWIFT_VERSION = 3.0;
796+
SWIFT_VERSION = 4.0;
793797
TARGETED_DEVICE_FAMILY = "1,2,3,4";
794798
TVOS_DEPLOYMENT_TARGET = 9.0;
795799
VALIDATE_PRODUCT = YES;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

SwiftyAttributes.xcodeproj/xcshareddata/xcschemes/ExampleApp-iOS.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -46,7 +45,6 @@
4645
buildConfiguration = "Debug"
4746
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4847
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49-
language = ""
5048
launchStyle = "0"
5149
useCustomWorkingDirectory = "NO"
5250
ignoresPersistentStateOnLaunch = "NO"

SwiftyAttributes.xcodeproj/xcshareddata/xcschemes/ExampleApp-macOS.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -46,7 +45,6 @@
4645
buildConfiguration = "Debug"
4746
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4847
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49-
language = ""
5048
launchStyle = "0"
5149
useCustomWorkingDirectory = "NO"
5250
ignoresPersistentStateOnLaunch = "NO"

SwiftyAttributes.xcodeproj/xcshareddata/xcschemes/SwiftyAttributes.xcscheme

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,9 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES"
31-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
3433
skipped = "NO">
@@ -57,7 +56,6 @@
5756
buildConfiguration = "Debug"
5857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60-
language = ""
6159
launchStyle = "0"
6260
useCustomWorkingDirectory = "NO"
6361
ignoresPersistentStateOnLaunch = "NO"

SwiftyAttributes.xcodeproj/xcshareddata/xcschemes/SwiftyAttributesTests.xcscheme

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -10,7 +10,6 @@
1010
buildConfiguration = "Debug"
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13-
language = ""
1413
shouldUseLaunchSchemeArgsEnv = "YES">
1514
<Testables>
1615
<TestableReference
@@ -35,7 +34,6 @@
3534
buildConfiguration = "Debug"
3635
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3736
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
38-
language = ""
3937
launchStyle = "0"
4038
useCustomWorkingDirectory = "NO"
4139
ignoresPersistentStateOnLaunch = "NO"

SwiftyAttributes/Sources/common/Attribute.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ public enum Attribute {
193193
case .verticalGlyphForm: ret = .verticalGlyphForm(VerticalGlyphForm(rawValue: validate(foundationValue))!)
194194
case .writingDirection:
195195
let values: [Int] = validate(foundationValue)
196-
ret = .writingDirections(values.flatMap(WritingDirection.init))
196+
#if swift(>=4.1)
197+
ret = .writingDirections(values.compactMap(WritingDirection.init))
198+
#else
199+
ret = .writingDirections(values.flatMap(WritingDirection.init))
200+
#endif
197201
default: break
198202
}
199203

codecov.yml

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ comment:
55
behavior: default
66
layout: header, diff
77
require_changes: false
8+
ignore:
9+
- "SwiftyAttributesTests"
810
coverage:
911
precision: 2
1012
range: "70...99"

0 commit comments

Comments
 (0)