Skip to content

Commit 9eb8540

Browse files
author
Christian Elies
committed
temporary mac catalyst fix
1 parent a7d8b85 commit 9eb8540

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Just pass your remote image url and `ViewBuilder`s for the error, image and load
1717

1818
Clear the image cache through `RemoteImageService.cache.removeAllObjects()`.
1919

20+
## TODO
21+
22+
- Load iCloud images (through local identifier)
23+
2024
## Example
2125

2226
The following code truly highlights the **simplicity** of this view:

Sources/RemoteImage/public/Views/RemoteImage.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ public struct RemoteImage<ErrorView: View, ImageView: View, LoadingView: View>:
1414
private let errorView: (Error) -> ErrorView
1515
private let imageView: (Image) -> ImageView
1616
private let loadingView: () -> LoadingView
17+
18+
#if !targetEnvironment(macCatalyst)
1719
@ObservedObject private var service: RemoteImageService = RemoteImageService()
20+
#else
21+
@EnvironmentObject var service: RemoteImageService
22+
#endif
1823

1924
public var body: AnyView {
2025
switch service.state {

0 commit comments

Comments
 (0)