I have a button that adds a product to the wishlist. After it has been clicked i want it to have "isEnabled" state when user returns to the same product page again.
Asked
Active
Viewed 13 times
1 Answers
0
Did you try to use a boolean to handle it? If not try it.

sandamal wijeweera
- 51
- 1
- 4
-
question is how to use user defaults – Юлия Кордюкова Jun 12 '17 at 17:30
-
`UserDefaults` has methods to save and read Boolean values. Those are probably a good place to start. – Tom Harrington Jun 12 '17 at 18:29
-
thank you! where shall i write the code? inside the button function or in viewdidload? – Юлия Кордюкова Jun 12 '17 at 21:31