UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Importing / Exporting test data

Forums > SwiftUI

I'm about 1/2 way through the 100 Days of SwiftUI, so the answer may be to just keep learning, however I'm also working on an app idea that got me started. From a high level it's a contacts-like app, so I need to be able to bring in a decent amount of data to properly test it.

What's the best practice for importing/exporting test data? Should I include a .json file in my project that I can load on demand, or build in something that can import/export .json from an actual device? Just curious if there's any best practices or other tools that help create and use test data.

Thanks!

2      

@Nick would like to meet a decent amount of people....

it's a contacts-like app, so I need to be able to bring in a decent amount of data to properly test it.

Sounds like a job for randomuser.me. This is an external site, am not proving a link.

But it allows for different address types (Canadian, European, 'Murca) It has long and short first names and family names. It generates fake email addresses, phone numbers, id numbers, and you can also get random photos.

There's many options, download test data for testing whilst building your interfaces. Also json interfaces for when you're ready to test your network code.

Another popular option is mockaroo.

If you're asking for best practices, I'd think you want to first focus on your app's functions. Get it working smoothly with a set of data that you have on your device. You can also set up a fake data service on your dev maching. Towards the end, you can link to external data sources and pound your network code.

Some of all of this advice might be ramblings. Good luck! Please return here and share you trials and victories.

Keep Coding

2      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

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

Archived topic

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.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.