(OLD) Storing user settings with UserDefaults – iExpense SwiftUI Tutorial 5/11

preview_player
Показать описание
In this technique project we build an expense tracking app with two views, ObservableObject, Codable, and UserDefaults.

Рекомендации по теме
Комментарии
Автор

Questions? Comments? Tweet me @twostraws.

twostraws
Автор

I am the android developer and almost newbie in the IOS world. the last year, I almost gave up to publish IOS App because of a lot of out-dated-resources and lack of references. but after I subscribed it and purchased your books also especially your blog's posts which well organized with up-to-date syntax posts help me to publish some apps. I appreciate it.

hanharry
Автор

Hahahaha 2:00 "As this is clearly a very important GOLD

chrispyk
Автор

Is there a way to alter the default value from 0 to another number or to change the default bool from false to true?

IamEchelon
Автор

Nice! It also worked to add an onAppear for the button and put the retrieve from defaults code in there. Would this cause issues?

judy
Автор

Does this work if i have a lot of questions in my app, that need short answers?

rcnttbu
Автор

This tutorial is very clear and very helpful! I'm trying to do a project that I know works in obj-c but I'd like to modernize it in Swift if possible. Do you know how to consume Managed App settings into UserDefaults? I'm not even sure if I'm asking that correctly. I want to send managed settings to my app via MDM and all signs point to UserDefaults to do just that. Here are some of the resources I've been banging my head against the wall with. Any help would be GREATLY appreciated!

mattgreen
Автор

Is it possible to trigger a block of code (for example save in UserDefaults) when the user edits the TextField, I have tried out onDisappear and onEditingChange but this doesn't save the last edit in the Textfield if the user closes the app before switching screens or doing something else. I think the option doesn't exist. For a UITextField I would use UITextFieldDelegate / textFieldDidChange

paulbird
join shbcf.ru