-
-
Save haikusw/97497874d97ccc1faffca96f654c0ff2 to your computer and use it in GitHub Desktop.
Swipe actions breaking ShareLink()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TestApp.swift | |
// TestApp | |
// | |
// Created by Craig Hockenberry on 12/19/24. | |
// | |
import SwiftUI | |
@main | |
struct TestApp: App { | |
var body: some Scene { | |
WindowGroup { | |
WTFView() | |
} | |
} | |
} | |
struct WTFView: View { | |
@State private var WTF = false | |
var body: some View { | |
Button("WTF!") { | |
WTF.toggle() | |
} | |
.sheet(isPresented: $WTF) { | |
// Tapping on the share icon produces something like this in the console: | |
// Attempt to present <UIActivityViewController: ..> on | |
// <_SwiftUI-UIHostingController-ModifiedContent-AnyView-RootModifier__: ..> | |
// (from <_SwiftUI-UIHostingController-ModifiedContent-AnyView-RootModifier__: ..>) | |
// which is already presenting <_SwiftUI-PresentationHostingController-AnyView_: ..>. | |
ShareLink(item: URL(string: "https://iconfactory.com")!) { | |
Label("Share", systemImage: "square.and.arrow.up") | |
.labelStyle(.iconOnly) | |
} | |
} | |
#if true // turn this off and ShareLink works fine | |
.swipeActions(edge: .leading) { | |
Button("OH RLY?") { | |
print("really.") | |
} | |
} | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment