|
My app gets a picture and associated data from the internet. When run, the app shows the example data and picture for a second or so, and then shows the data and image I am expecting. I do not want to show the example image and data. Here is part of the program .
|
|
Do you have default values for As a HWS+ member you have access to https://www.hackingwithswift.com/plus/ultimate-portfolio-app/cleaning-up-cloudkit-part-1. This video should only give you hints how to implement a loading state and can't be used 1:1 for your use case. |
|
sorry I am probably not explaining myself very well. I want to stop the example image and data from showing when the app runs. Viewing the sample image is expected and fine whilst designing the screen, but I cannot see why it shows for a brief time when the app runs. |
|
(See Below) Bear in mind that you are download data and if it takes a while user may not know what happening. If you do something like this which will overlay a view as it download it
|
|
I still think that Picture has the sample values as default values. Otherwise, the code in the first post wouldn't work and crash if picture was nil. So I doubt the solution works. |
|
|
|
Yes, I know. But we don't know what is passed into ContentView and according to the code in the first post something has to be passed into ContentView. Otherwise, it wouldn't compile or crash when picture was nil. So, unless the calling part is not changed your code example wouldn't help because picture isn't nil and we should see the same effect unless the network call is done. That's why I asked are there any default values in Picture set and these are shown for the short period of time? |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's all new Paywall Editor allow you to remotely configure your paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.