diff options
| author | Fuwn <[email protected]> | 2025-02-22 06:52:14 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-02-22 06:52:14 -0800 |
| commit | b2acdb1c989ccf07a41c34848f47bc491fec2ecc (patch) | |
| tree | 77e0613fa19e58150ee5709369536219be2a045b /Sora | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-b2acdb1c989ccf07a41c34848f47bc491fec2ecc.tar.xz sora-testing-b2acdb1c989ccf07a41c34848f47bc491fec2ecc.zip | |
feat: Development commit
Diffstat (limited to 'Sora')
| -rw-r--r-- | Sora/Other/AsyncImageWithPreview.swift | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Sora/Other/AsyncImageWithPreview.swift b/Sora/Other/AsyncImageWithPreview.swift index 488e66e..56af307 100644 --- a/Sora/Other/AsyncImageWithPreview.swift +++ b/Sora/Other/AsyncImageWithPreview.swift @@ -12,18 +12,20 @@ struct AsyncImageWithPreview<Placeholder: View>: View { @State private var currentOffset: CGSize = .zero @State private var finalOffset: CGSize = .zero - var keyWindow: UIWindow? { - guard - let window = UIApplication.shared.connectedScenes - .compactMap({ $0 as? UIWindowScene }) - .flatMap(\.windows) - .first(where: \.isKeyWindow) - else { - return nil - } + #if os(iOS) + var keyWindow: UIWindow? { + guard + let window = UIApplication.shared.connectedScenes + .compactMap({ $0 as? UIWindowScene }) + .flatMap(\.windows) + .first(where: \.isKeyWindow) + else { + return nil + } - return window - } + return window + } + #endif var body: some View { AsyncImage(url: url) { image in |