I want to find the rangeOfString for multiple items and have tried using an array with a for-in loop, however this just cycles to the last term of the array and uses that for the rangeOfString. Is it possible to use an array with rangeOfString so it searches all terms concurrently or do I have to write the rangeOfString individually for each term.
while true {
let attempts = ["goodmorning","goodbye", "hello", "hi"]
for attempt in attempts{
tru = attempt
let range = text.rangeOfString(tru, options: [], range: searchRange)