What is the proper way to append an element on the end of an optional array? Let's say I have an optional array, myArray, and I want to append '99' on the end. Append() does not work on a nil array, so the only solution I can find is the following, but it doesn't seem very elegant:
var myArray = [Int]?()
if myArray?.count > 0 {
myArray?.append(99)
} else {
myArray = [99]
}