Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9 from byMohamedali/fix/macOS-compile
Browse files Browse the repository at this point in the history
  • Loading branch information
kean authored Jun 20, 2021
2 parents 9a4a07f + a27be14 commit 4516371
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/kean/Nuke.git",
"state": {
"branch": null,
"revision": "5a8d11b4b8fd631f2937d2e41910ae329aed31b7",
"version": "10.0.0"
"revision": "69ae6d5b8c4b898450432f94bd35f863d3830cfc",
"version": "10.3.0"
}
}
]
Expand Down
11 changes: 11 additions & 0 deletions Sources/Internal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ extension UIView.ContentMode {

#endif

#if os(tvOS) || os(watchOS)
import UIKit

extension UIColor {
@objc(secondarySystemBackgroundColor)
public static var secondarySystemBackground: UIColor {
return lightGray.withAlphaComponent(0.5)
}
}
#endif

extension ImageRequest {
struct ID: Hashable {
let imageId: String?
Expand Down
4 changes: 3 additions & 1 deletion Sources/LazyImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public struct LazyImage<Content: View>: View {
}
#endif
} else {
Rectangle().foregroundColor(Color(_PlatformColor.secondarySystemBackground))
Rectangle().foregroundColor(Color(.secondarySystemBackground))
}
}

Expand Down Expand Up @@ -267,6 +267,8 @@ public struct LazyImageState {
public var image: Image? {
#if os(macOS)
return imageContainer.map { Image($0.image) }
#elseif os(watchOS)
return imageContainer.map { Image(uiImage: $0.image) }
#else
return imageContainer.map { Image($0.image) }
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/LazyImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public final class LazyImageView: _PlatformBaseView {
if #available(iOS 13.0, *) {
color = .secondarySystemBackground
} else {
color = UIColor.lightGray.withAlphaComponent(0.5)
color = _PlatformColor.lightGray.withAlphaComponent(0.5)
}
#if os(macOS)
view.wantsLayer = true
Expand Down

0 comments on commit 4516371

Please sign in to comment.