Skip to content

Commit e07abe7

Browse files
committed
Bump to minimum sdk and fixes compilation error
1 parent fc8427c commit e07abe7

File tree

8 files changed

+57
-31
lines changed

8 files changed

+57
-31
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ The following properties are available:
706706
## Requirements
707707

708708
* Swift 5.1+
709-
* iOS 8.0+
709+
* iOS 9.0+
710710
* macOS 11.0+
711711
* watchOS 2.0+
712712
* tvOS 11.0+

Sources/SwiftRichString/Attributes/TextTransform.swift

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,34 @@ public enum TextTransform {
4545
var transformer: TransformFunction {
4646
switch self {
4747
case .lowercase:
48-
return { string in string.localizedLowercase }
48+
return { string in
49+
string.localizedLowercase
50+
}
4951

5052
case .uppercase:
51-
return { string in string.localizedUppercase }
53+
return { string in
54+
string.localizedUppercase
55+
}
5256

5357
case .capitalized:
54-
return { string in string.localizedCapitalized }
58+
return { string in
59+
string.localizedCapitalized
60+
}
5561

5662
case .lowercaseWithLocale(let locale):
57-
return { string in string.lowercased(with: locale) }
63+
return { string in
64+
string.lowercased(with: locale)
65+
}
5866

5967
case .uppercaseWithLocale(let locale):
60-
return { string in string.uppercased(with: locale) }
68+
return { string in
69+
string.uppercased(with: locale)
70+
}
6171

6272
case .capitalizedWithLocale(let locale):
63-
return { string in string.capitalized(with: locale) }
73+
return { string in
74+
string.capitalized(with: locale)
75+
}
6476

6577
case .custom(let transform):
6678
return transform

Sources/SwiftRichString/Extensions/AttributedString+Attachments.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import AppKit
3636
import UIKit
3737
#endif
3838

39-
#if os(OSX) || os(iOS)
39+
#if os(iOS)
4040

4141
public extension AttributedString {
4242

Sources/SwiftRichString/Support/AsyncTextAttachment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import UIKit
3535
import MobileCoreServices
3636
#endif
3737

38-
#if os(iOS) || os(OSX)
38+
#if os(iOS)
3939

4040
@objc public protocol AsyncTextAttachmentDelegate
4141
{

Sources/SwiftRichString/Support/Extensions.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,20 @@ extension CGRect {
113113
}
114114

115115
}
116+
117+
#if os(OSX)
118+
119+
public extension NSImage {
120+
121+
/// PNG data of the image.
122+
func pngData() -> Data? {
123+
self.lockFocus()
124+
let bitmap = NSBitmapImageRep(focusedViewRect: NSRect(x: 0, y: 0, width: size.width, height: size.height))
125+
let pngData = bitmap!.representation(using: .png, properties: [:])
126+
self.unlockFocus()
127+
return pngData
128+
}
129+
130+
}
131+
132+
#endif

Sources/SwiftRichString/Support/XMLDynamicAttributesResolver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ open class StandardXMLAttributesResolver: XMLDynamicAttributesResolver {
8686
case "a": // href support
8787
finalStyleToApply.linkURL = URL(string: attributes?["href"])
8888

89-
#if os(OSX) || os(iOS)
89+
#if os(iOS)
9090
case "img":
9191
if let url = attributes?["url"] {
9292
if let image = AttributedString(imageURL: url, bounds: attributes?["rect"]) {

SwiftRichString.xcodeproj/project.pbxproj

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,8 @@
15581558
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
15591559
GCC_WARN_UNUSED_FUNCTION = YES;
15601560
GCC_WARN_UNUSED_VARIABLE = YES;
1561-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1561+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1562+
MACOSX_DEPLOYMENT_TARGET = 10.11;
15621563
MTL_ENABLE_DEBUG_INFO = YES;
15631564
ONLY_ACTIVE_ARCH = YES;
15641565
SDKROOT = iphoneos;
@@ -1611,7 +1612,8 @@
16111612
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
16121613
GCC_WARN_UNUSED_FUNCTION = YES;
16131614
GCC_WARN_UNUSED_VARIABLE = YES;
1614-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1615+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1616+
MACOSX_DEPLOYMENT_TARGET = 10.11;
16151617
MTL_ENABLE_DEBUG_INFO = NO;
16161618
SDKROOT = iphoneos;
16171619
SWIFT_VERSION = 5.0;
@@ -1636,6 +1638,7 @@
16361638
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
16371639
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
16381640
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1641+
MACOSX_DEPLOYMENT_TARGET = 10.11;
16391642
MARKETING_VERSION = 3.5.0;
16401643
ONLY_ACTIVE_ARCH = NO;
16411644
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-iOS";
@@ -1660,6 +1663,7 @@
16601663
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
16611664
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
16621665
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1666+
MACOSX_DEPLOYMENT_TARGET = 10.11;
16631667
MARKETING_VERSION = 3.5.0;
16641668
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-iOS";
16651669
PRODUCT_NAME = SwiftRichString;
@@ -1709,7 +1713,9 @@
17091713
DYLIB_INSTALL_NAME_BASE = "@rpath";
17101714
INFOPLIST_FILE = Configs/SwiftRichString.plist;
17111715
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1716+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
17121717
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1718+
MACOSX_DEPLOYMENT_TARGET = 10.11;
17131719
MARKETING_VERSION = 3.5.0;
17141720
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-watchOS";
17151721
PRODUCT_NAME = SwiftRichString;
@@ -1734,7 +1740,9 @@
17341740
DYLIB_INSTALL_NAME_BASE = "@rpath";
17351741
INFOPLIST_FILE = Configs/SwiftRichString.plist;
17361742
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1743+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
17371744
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1745+
MACOSX_DEPLOYMENT_TARGET = 10.11;
17381746
MARKETING_VERSION = 3.5.0;
17391747
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-watchOS";
17401748
PRODUCT_NAME = SwiftRichString;
@@ -1759,7 +1767,9 @@
17591767
DYLIB_INSTALL_NAME_BASE = "@rpath";
17601768
INFOPLIST_FILE = Configs/SwiftRichString.plist;
17611769
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1770+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
17621771
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1772+
MACOSX_DEPLOYMENT_TARGET = 10.11;
17631773
MARKETING_VERSION = 3.5.0;
17641774
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-tvOS";
17651775
PRODUCT_NAME = SwiftRichString;
@@ -1784,7 +1794,9 @@
17841794
DYLIB_INSTALL_NAME_BASE = "@rpath";
17851795
INFOPLIST_FILE = Configs/SwiftRichString.plist;
17861796
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1797+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
17871798
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1799+
MACOSX_DEPLOYMENT_TARGET = 10.11;
17881800
MARKETING_VERSION = 3.5.0;
17891801
PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-tvOS";
17901802
PRODUCT_NAME = SwiftRichString;
@@ -1811,6 +1823,7 @@
18111823
FRAMEWORK_VERSION = A;
18121824
INFOPLIST_FILE = Configs/SwiftRichString.plist;
18131825
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1826+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
18141827
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
18151828
MACOSX_DEPLOYMENT_TARGET = 10.11;
18161829
MARKETING_VERSION = 3.5.0;
@@ -1837,6 +1850,7 @@
18371850
FRAMEWORK_VERSION = A;
18381851
INFOPLIST_FILE = Configs/SwiftRichString.plist;
18391852
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1853+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
18401854
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
18411855
MACOSX_DEPLOYMENT_TARGET = 10.11;
18421856
MARKETING_VERSION = 3.5.0;
@@ -2084,7 +2098,7 @@
20842098
GCC_C_LANGUAGE_STANDARD = gnu11;
20852099
INFOPLIST_FILE = ExampleMac/Info.plist;
20862100
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
2087-
MACOSX_DEPLOYMENT_TARGET = 10.9;
2101+
MACOSX_DEPLOYMENT_TARGET = 10.11;
20882102
PRODUCT_BUNDLE_IDENTIFIER = com.swiftrichstring.ExampleMac;
20892103
PRODUCT_NAME = "$(TARGET_NAME)";
20902104
SDKROOT = macosx;
@@ -2114,7 +2128,7 @@
21142128
GCC_C_LANGUAGE_STANDARD = gnu11;
21152129
INFOPLIST_FILE = ExampleMac/Info.plist;
21162130
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
2117-
MACOSX_DEPLOYMENT_TARGET = 10.9;
2131+
MACOSX_DEPLOYMENT_TARGET = 10.11;
21182132
PRODUCT_BUNDLE_IDENTIFIER = com.swiftrichstring.ExampleMac;
21192133
PRODUCT_NAME = "$(TARGET_NAME)";
21202134
SDKROOT = macosx;

SwiftRichString.xcodeproj/xcuserdata/daniele.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,5 @@
2121
landmarkType = "3">
2222
</BreakpointContent>
2323
</BreakpointProxy>
24-
<BreakpointProxy
25-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
26-
<BreakpointContent
27-
uuid = "BD7B674C-CEAD-4F12-975E-4F6ADE163FE4"
28-
shouldBeEnabled = "Yes"
29-
ignoreCount = "0"
30-
continueAfterRunningActions = "No"
31-
filePath = "Sources/SwiftRichString/Extensions/UIKit+Extras.swift"
32-
timestampString = "548505331.301144"
33-
startingColumnNumber = "9223372036854775807"
34-
endingColumnNumber = "9223372036854775807"
35-
startingLineNumber = "51"
36-
endingLineNumber = "51"
37-
landmarkName = "styleName"
38-
landmarkType = "24">
39-
</BreakpointContent>
40-
</BreakpointProxy>
4124
</Breakpoints>
4225
</Bucket>

0 commit comments

Comments
 (0)