Like the title says… I’m trying to use the new Link syntax in a sheet modifier but I’m running in to all kinds of problems. This is a Sean Allen tutorial that I am just playing with and trying to add some of the new swift features to.
What is currently working is:
@State private var isShowingSafariView = false
Button {
isShowingWebView = true
} label: {
AFButton(title: "Learn More")
}
.fullScreenCover(isPresented: $isShowingSafariView, content: {
SafariView(url: URL(string: framework.urlString) ?? URL(string: "www.apple.com")!)
})
Of course SafariView is handling the URL/View, but I was trying to simplify this and not use it at all.
I’ve made this work, but it requires a complete overhaul of how I’ve built the button. I’m pretty new and I was just trying to figure out if there was just something super simple that I’ve missed.
My desired result is something like this:
@State private var isShowingSafariView = false
Button {
isShowingSafariView = true
} label: {
AFButton(title: "Learn More")
}
.fullScreenCover(isPresented: $isShowingSafariView, content: {
Link(URL(string: framework.urlString)!)
})