Questions tagged [swiftyuserdefaults]

SwiftyUserDefaults is a modern Swift API for NSUserDefaults

SwiftyUserDefaults makes user defaults enjoyable to use by combining expressive Swifty API with the benefits of static typing. Define your keys in one place, use value types easily, and get extra safety and convenient compile-time checks for free.

26 questions
0
votes
0 answers

Change the background of a UILabel in ViewController when I slide left or right a Slider in a Settings Bundle

I need to change 1 label background using a Sliders located in a Settings Bundler. When I slide to right my UILabel background need to get a shade of red and when I change to left my UILabel need to get a shade of black. Here I have 3 screenshots…
Florentin Lupascu
  • 754
  • 11
  • 30
0
votes
1 answer

Set a dynamic image on prototype cell?

I want to display on "Profile" cell the image of the user. To do that I supposed to use the same snippet that solve the profile load. First of all I declared an UIImageView! variable: var accountimage: UIImageView! Then, in my cellForRowAtIndexPath…
0
votes
2 answers

Save and Add integer value in UserDefaults and retrieve after adding the value

I can save and retrieve deleted mails number (such as like Integer value) in UserDefaults. Suppose if I deleted some more mails then I have to add/increase that saved UserDefaults value and if I retrieve it should come total deleted mails number.…
user8769899
0
votes
1 answer

How to put .setTitle parameter for Button in the UserDefaults and in viewDidLoad

Maybe someone of you know how to put clearButton.setTitle parameter in the UserDefaults and after that put to override func viewDidLoad() { That's parameters which i'm try to put before viewDidLoad to prepare a key, but i think defaults.set is…
Ula
  • 167
  • 1
  • 2
  • 11
0
votes
0 answers

Using UserDefaults

If I run the following code in a Playground, it correctly prints out "here 1" However, if I run the code in my app using from a class function, it prints out "here". How do I correctly test if I have an array saved? if let savedArray =…
0
votes
2 answers

First time launch / segue swift

what i am trying to accomplish is once the app is launched it will check for first time use. if it is the first time use it will take you to a view controller to enter credentials, else it will take you to to the main menu of the app. this is what i…
0
votes
1 answer

Sign up button clicked function

user.signUpInBackground{ (success: Bool, error:Error?) in if success{ print("signed up") UserDefaults.standard.set(user.username, forKey: "username") UserDefaults.standard.synchronize() user.signUpInBackground…
Wilson
  • 49
  • 6
0
votes
1 answer

Swfit - How can I use the UserDefaults to store variable and how to load the variable from UserDefaults next time

I need to store some variables like ione and itwo which for method repeat. The variables value will increase,after increased,I want to store the increased variables into userdefaults. import UIKit class ViewController: UIViewController { …
h4g
  • 1
  • 1
-2
votes
0 answers

How can I code a tutorial to show up for a first time user of my app?

I am a new coder. I am trying to program a feature in a game so that if it is the first time the user has logged into the app, the user will be presented with a tutorial; however, it doesn't seem to save. It does change, but it just doesn't…
-2
votes
2 answers

UserDefaults.standard.set() is not working

I have a reset function that sets an empty string for every key in UserDefaults.standard but it isn't actually resetting them, sometimes it works, sometimes it doesn't, and the weird thing is that sometimes it reset only a few values. There's…
cam0347
  • 23
  • 3
-2
votes
1 answer

Swift - XCode 7 - userDefaults messing up array on save

I have been carrying values on my app through a global variable declared on the first View Controller. It's value is updated whenever the app is reopened. When the user is on the same session, the array appends propperly, but when I save it through…
Gabriel Robaina
  • 709
  • 9
  • 24
1
2