Posts

Post marked as solved
6 Replies
I do but leave the int.random will show me the cards in a random order. I want to show them in order of their name (card1, card2, card3...card26)
Post not yet marked as solved
2 Replies
I know this was posted like 6 months ago but I’ve come to find out copy and pasting a project folder is bad! Learned the hard way but fortunately it wasn’t too bad. Doing that somehow moved my imageassets so I was stuck copying them back and then some other stuff.
Post not yet marked as solved
4 Replies
First off, thank you for taking the time to help me. ill try to make this as clear as i possibly can 🙂I have two ViewControllers; one is a user interface with a few labels, textboxes, pickerviews and buttons. On that VC i use a segue to go into the second viewcontroller to change 1 setting using a segmented control and a back button using a segue to go back. That segmented control is basically "LBs & INs" and "KGs & CMs" index values of 0 and 1. Im already able to save the segment controller state on that view with no problem - works every time.What i now want to do is on the first viewcontroller with the labels, is change a label IF the saved segment control index is 0 or 1. So in my head, i would add an if statement to the viewdidload possibly - if the userdefault segment control selected state index is 0 set the label.text to the segment control title or i could hardcode it here. If segment control state index is 0, then label.text = LBs & INs" else if index is 1 then label.text = "KGs & CMs".Basically when a user loads my app, a label is dependent on what the segment control index is saved as on the settings VC.
Post not yet marked as solved
4 Replies
I only want to call a key if the segmented control index is 0. So how would my if statement look if i saved a string to userdefaults and i saved the segmented control selected index to userdefaults.Basically, if selectedstateindex = 0 then label.text = key1 else if selectedstateindex = 1 then label.text = key2