TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Previews - sigh

Forums > SwiftUI

Am I the only one that finds I spend MORE time trying to get previews to work than it saves me? I typically end up frustrated and just compiling and running in the simulator.

Anyone have a suggestion of a good tutorial on real world application use of previews and how to get them to work?

TIA, (I appologize for the rant...)

2      

Completely agree, I had great dofficulties until recently until I found that I could work things out easier using the #Preview struct instead of viewname_preview. This allowed me to do more setup.

There are still some things I need to work out for my project but I will have the same problems in the simulator (I want to make sure that the user is on a pre determined wifi network before allowing some actions but this isnt possible in preview or simulator, suspect I will need ot mock)

3      

Hacking with Swift is sponsored by Blaze.

SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!

Reserve your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.