![]() Next back inside the viewDidLoad() after our defaults line, we will get and assign the values. Now we can use those and never have to worry about typing a name wrong. let textFieldKe圜onstant = “textFieldKeyName” Just inside the class, add two constants, one for the text field key name, and another for the switch key name. To do that we will use constants for them. Since we would expect to use the key names for reading and writing, we want to minimize the chances of typo’s. Since we want to be a good Swift citizen we will use a let rather than var. Load Our Settings on Application Loadįirst, we need to get access to NSUserDefault, we will do that in the viewDidLoad() for this example.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |