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...)


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)


Hacking with Swift is sponsored by Superwall.

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

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.