What i've tried was using a for-in loop, however that just cycles to the last value and gives me the rangeOfString for that value. It would be a lot to write the rangeOfString for all the values i want but if needed I don't mind. I just wanted to know if it was possible to use an array instead.
while true {
let attempts = ["hello","goodbye"]
for attempt in attempts{
tru = attempt
let range = text.rangeOfString("hello", options: [], range: searchRange)