I have an Array that is declared as:
var stringsArray: Array<String!> = []
I want to add items to it using code along these lines:
stringsArray.append("String 1")
However, I would like to use an if statement to detect whether or not what is about to be appended already exists in stringsArray and if it does, I would like the code to append not to be ran.
I am using Swift.
Setwould be a better choice?...Setdoes not have defined ordering but I do need to be manipulate the order of the contents. Am I able to do this using aSet?NSMutableOrderedSet