ios - Swift 2.0 Defer Not working in XCode 7.0.1? -
i have simple block of code defer block, playground not executing defer block. doing wrong?
the following gets printed: "step 1" "step 3" "step 4" "step 5"
import uikit  print("step 1")  {     defer { print("step 2") }     print("step 3")     print("step 4") }   print("step 5")      
are sure looking @ console? if so, there must bug in playground. here got code:
 http://i.stack.imgur.com/en6kn.png
Comments
Post a Comment