Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to load dynamic url #33

Open
haolidong opened this issue Mar 2, 2022 · 2 comments
Open

How to load dynamic url #33

haolidong opened this issue Mar 2, 2022 · 2 comments

Comments

@haolidong
Copy link

haolidong commented Mar 2, 2022

initial
var url = "https://www.github.com"

after click a button or other event, url become another value
url = "https://www.google.com"

the SafariView how to load the lasted url

@viere1234
Copy link

viere1234 commented May 11, 2022

It's better to use URL structure as a dynamic variable.
@State var currentUrl = URL(string: "(Initial website)")!
And click a button to pass a different URL.
currentUrl = URL(string: "(Website you want to open)")!

And just simply put currentURL into SafariView.

@alexsorokoletov
Copy link

Funny, the same thing works with @Published, but not with @State.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants