import Foundation

func _pollBlock(#pollInterval: NSTimeInterval, #timeoutInterval: NSTimeInterval, expression: () -> Bool) -> Bool {
    let startDate = NSDate()
    var pass: Bool
    do {
        pass = expression()
        if pass {
            break
        }

        let runDate = NSDate().dateByAddingTimeInterval(pollInterval) as NSDate
        NSRunLoop.mainRunLoop().runUntilDate(runDate)
    } while(NSDate().timeIntervalSinceDate(startDate) < timeoutInterval);

    return pass
}

import Foundation

func _pollBlock(#pollInterval: NSTimeInterval, #timeoutInterval: NSTimeInterval, expression: () -> Bool) -> Bool {
    let startDate = NSDate()
    var pass: Bool
    do {
        pass = expression()
        let runDate = NSDate().dateByAddingTimeInterval(pollInterval) as NSDate
        NSRunLoop.mainRunLoop().runUntilDate(runDate)
    } while(!pass && NSDate().timeIntervalSinceDate(startDate) < timeoutInterval);
    return pass
}

--- 
+++ 
@@ -5,8 +5,13 @@
     var pass: Bool
     do {
         pass = expression()
+        if pass {
+            break
+        }
+
         let runDate = NSDate().dateByAddingTimeInterval(pollInterval) as NSDate
         NSRunLoop.mainRunLoop().runUntilDate(runDate)
-    } while(!pass && NSDate().timeIntervalSinceDate(startDate) < timeoutInterval);
+    } while(NSDate().timeIntervalSinceDate(startDate) < timeoutInterval);
+
     return pass
 }
Exit polling early if condition is already met
