I want to create an array of Ints that I can append to and will be saved to UserDefaults so that next time the user opens the app, the array will be saved. So, I know how to create a UserDefaults array...
var intArray = UserDefaults.standard.array(forKey: "intArray") as! [Int]
and I know how to set the array to an already existing array:
var array = [2, 6, 34, 4, 9]
UserDefaults.standard.set(array, forKey: "intsArray")
But, I need the array to be empty and then the user adds Ints to the array. Thanks for your help!