Skip to content

Commit 4b3cb00

Browse files
committed
Fixed mac compatibility.
1 parent c13b24e commit 4b3cb00

File tree

5 files changed

+32
-10
lines changed

5 files changed

+32
-10
lines changed

Example Apps/SparrowKit.xcodeproj/xcshareddata/xcschemes/watchOS Example.xcscheme

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,46 @@
5454
debugDocumentVersioning = "YES"
5555
debugServiceExtension = "internal"
5656
allowLocationSimulation = "YES">
57-
<BuildableProductRunnable
58-
runnableDebuggingMode = "0">
57+
<RemoteRunnable
58+
runnableDebuggingMode = "2"
59+
BundleIdentifier = "com.apple.Carousel"
60+
RemotePath = "/(null)">
5961
<BuildableReference
6062
BuildableIdentifier = "primary"
6163
BlueprintIdentifier = "F43F8319265791A0001D9B3D"
6264
BuildableName = "watchOS Example.app"
6365
BlueprintName = "watchOS Example"
6466
ReferencedContainer = "container:SparrowKit.xcodeproj">
6567
</BuildableReference>
66-
</BuildableProductRunnable>
68+
</RemoteRunnable>
6769
</LaunchAction>
6870
<ProfileAction
6971
buildConfiguration = "Release"
7072
shouldUseLaunchSchemeArgsEnv = "YES"
7173
savedToolIdentifier = ""
7274
useCustomWorkingDirectory = "NO"
7375
debugDocumentVersioning = "YES">
74-
<BuildableProductRunnable
75-
runnableDebuggingMode = "0">
76+
<RemoteRunnable
77+
runnableDebuggingMode = "2"
78+
BundleIdentifier = "com.apple.Carousel"
79+
RemotePath = "/(null)">
7680
<BuildableReference
7781
BuildableIdentifier = "primary"
7882
BlueprintIdentifier = "F43F8319265791A0001D9B3D"
7983
BuildableName = "watchOS Example.app"
8084
BlueprintName = "watchOS Example"
8185
ReferencedContainer = "container:SparrowKit.xcodeproj">
8286
</BuildableReference>
83-
</BuildableProductRunnable>
87+
</RemoteRunnable>
88+
<MacroExpansion>
89+
<BuildableReference
90+
BuildableIdentifier = "primary"
91+
BlueprintIdentifier = "F43F8319265791A0001D9B3D"
92+
BuildableName = "watchOS Example.app"
93+
BlueprintName = "watchOS Example"
94+
ReferencedContainer = "container:SparrowKit.xcodeproj">
95+
</BuildableReference>
96+
</MacroExpansion>
8497
</ProfileAction>
8598
<AnalyzeAction
8699
buildConfiguration = "Debug">

Sources/SparrowKit/Foundation/Classes/SPLocale.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public enum SPLocale: String {
7474
/**
7575
SparrowKit: Localize description of language.
7676
*/
77+
@available(iOS 11.0, tvOS 11.0, macOS 10.11, *)
7778
public func description(in locale: SPLocale) -> String {
7879
let locale = NSLocale(localeIdentifier: locale.languageCode)
7980
let text = locale.displayName(forKey: NSLocale.Key.identifier, value: languageCode) ?? .empty

Sources/SparrowKit/UIKit/Extensions/UIColorExtension.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,21 @@ extension UIColor {
104104
@available(tvOSApplicationExtension, unavailable)
105105
public static var tint: UIColor {
106106
get {
107-
if #available(iOS 15.0, tvOS 15.0, *) {
108-
return UIColor.tintColor
109-
} else {
107+
let byWindow = { () -> UIColor in
110108
let value = UIApplication.shared.windows.first?.tintColor
111109
guard let tint = value else { return .systemBlue }
112110
return tint
113111
}
112+
#if targetEnvironment(macCatalyst)
113+
return byWindow()
114+
#else
115+
if #available(iOS 15.0, tvOS 15.0, *) {
116+
return UIColor.tintColor
117+
} else {
118+
return byWindow()
119+
}
120+
#endif
121+
114122
}
115123
set {
116124
UIApplication.shared.windows.forEach({ $0.tintColor = newValue })

SparrowKit.podspec

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

33
s.name = 'SparrowKit'
4-
s.version = '3.3.1'
4+
s.version = '3.3.2'
55
s.summary = 'Collection of native Swift extensions to boost your development. Support tvOS and watchOS.'
66
s.homepage = 'https://github.com/ivanvorobei/SparrowKit'
77
s.source = { :git => 'https://github.com/ivanvorobei/SparrowKit.git', :tag => s.version }

0 commit comments

Comments
 (0)