the original code can't run due to Xcode(6.1) and Swift compiler update.