BLACK FRIDAY: Save 50% on all my Swift books and bundles! >>

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      

Save 50% in my WWDC sale.

SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

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.