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

Day 74 Challenge - Solved

Forums > 100 Days of Swift

Anyone having a LOADS of trouble with this project ( challange for Milestone: Projects 19-21) ?

https://www.hackingwithswift.com/guide/8/3/challenge

I am stuck on how to save the texts in the detailViewcontroller to userdefault, and pull that same text from the main VC and put it in a table view.

Anyone has completed this and wants to share the Github link for it?

Cheers guys.

3      

Same trouble here. Would appreciate any help.

3      

This is one area where UserDefaults is not optimal but for purposes of the challenge is ok. Basically you need to be saving array of Note classes each time you write or edit note.

This is one area where classes will work much better, because you can send just the reference to detail view controller, where you will display the text and possibly edit it.

I would save data either after each edit (meaning encoding the whole array and saving it into user defaults) or when user exits the app. There are special methods inside of AppDelegate to help with this.

4      

I actually found an awesome tutorial online and helped me solve this. Completion closure save lives.. haha

5      

Hello! Can you share the tutorial link?

3      

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.