From b2acdb1c989ccf07a41c34848f47bc491fec2ecc Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 22 Feb 2025 06:52:14 -0800 Subject: feat: Development commit --- .../xcshareddata/xcschemes/Sora.xcscheme | 78 ++++++++++++++++++++++ Sora/Other/AsyncImageWithPreview.swift | 24 ++++--- 2 files changed, 91 insertions(+), 11 deletions(-) create mode 100644 Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme diff --git a/Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme b/Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme new file mode 100644 index 0000000..3608e1d --- /dev/null +++ b/Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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: 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 -- cgit v1.2.3