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

SOLVED: Read and Write JSON to documents directory

Forums > iOS

Hi All,

I am very new to SwiftUI and have been working through Apple's Tutorial (https://developer.apple.com/tutorials/swiftui).

I have finished the tutorial and wanted to go one step further and allow the app user to add to and edit the landmarks currently stored in the JSON in the main bundle.

I understand that this is not possible and that I would need to copy the JSON to the Documents Directory and then read/write from there.

I cannot work out how to do this.

Is it possible? If so how would i go about it?

Thanks in advance!

Chris

4      

You only reference Apple's tutorial. Yet, you are on one of the BEST SwiftUI sites in the world.

Which of the HackingWithSwift tutorials have you watched regarding JSON and JSON decoders?

You have a very generic question. Start with @twostraws' tutorials. Work your way through his 100 Days of SwiftUI videos and assignments. When you have specific questions about JSON, SwiftUI code, or concepts, we'll be here ready to help.

4      

In this video by Stewart Lynch shows how to do save JSON to FileDirectory

JSON Decoding Playground for Swift

I think also that 100 Days of SwiftUI is about to do it starting at Day 68 – Project 14, part one

4      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

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.