şöyle birşeyler olabilir mesela;
func findTheNextPrimes(start: Int, count: Int) -> [Int] {
        var result = [Int]()
        if count > 0 {
            if isThisAPrime(start + 1) {
                result.append(start + 1)
                result.append(contentsOf: findTheNextPrimes(start: start + 1, count: count - 1))
                result = result.sorted(by: <)
            } else {
                result = findTheNextPrimes(start: start + 1, count: count)
            }
        }
        return result
    }
    func isThisAPrime(_ value:Any) -> Bool {
        var integer:Int = 0
        if let intValue = value as? Int {
            integer = intValue
        } else if let stringValue = value as? String {
            if let stringValInDouble = Double(stringValue) {
                if stringValInDouble == Double(Int(stringValInDouble)) {
                    integer = Int(stringValInDouble)
                }
            }
        } else if let doubleValue = value as? Double {
            if doubleValue == Double(Int(doubleValue)) {
                integer = Int(doubleValue)
            }
        }
        if integer < 0 {
            return false
        }
        switch integer {
        case 0, 1:
            return false
        case 2, 3:
            return true
        default:
            for i in 2...Int(sqrt(Double(integer))) {
                if integer % i == 0 {
                    return false
                }
            }
            return true
        }
    }
şöyle kullanırsın;
//34'den sonra gelen 10 asal sayıyı gösterir
        let primes = findTheNextPrimes(start: 34, count: 10)
        print(primes) //[37, 41, 43, 47, 53, 59, 61, 67, 71, 73]
        //herhangi bir data tipi olabilir (integer, text, double)
        //tam sayıya çevrilebilir bir tekst eğer asalsa true değeri döner
        print("\"hello world\"  : \(isThisAPrime("hello world"))")  //false
        print("\"37\"           : \(isThisAPrime("37"))")           //true
        print("\"36\"           : \(isThisAPrime("36"))")           //false
        print("\"43.0\"         : \(isThisAPrime("43.0"))")         //true
        print("\"43.2\"         : \(isThisAPrime("43.2"))")         //false
        print("\"41\"           : \(isThisAPrime("41"))")           //true
        print("44               : \(isThisAPrime(44))")             //false
        print("47               : \(isThisAPrime(47))")             //true
        print("53.0             : \(isThisAPrime(53.0))")           //true
        print("53.2             : \(isThisAPrime(53.1))")           //false
        //döngü içerisinde kullanımı
        for i in 0..<12 {
            if isThisAPrime(i) {
                print(i)
            }
        }