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      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

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.