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 | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-b2acdb1c989ccf07a41c34848f47bc491fec2ecc.tar.xz sora-testing-b2acdb1c989ccf07a41c34848f47bc491fec2ecc.zip | |
feat: Development commit
| -rw-r--r-- | Sora.xcodeproj/xcshareddata/xcschemes/Sora.xcscheme | 78 | ||||
| -rw-r--r-- | Sora/Other/AsyncImageWithPreview.swift | 24 |
2 files changed, 91 insertions, 11 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1620" + version = "1.7"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "4CD342752D6341D900565E6F" + BuildableName = "Sora.app" + BlueprintName = "Sora" + ReferencedContainer = "container:Sora.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "4CD342752D6341D900565E6F" + BuildableName = "Sora.app" + BlueprintName = "Sora" + ReferencedContainer = "container:Sora.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "4CD342752D6341D900565E6F" + BuildableName = "Sora.app" + BlueprintName = "Sora" + ReferencedContainer = "container:Sora.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> 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 |