updated swift code for Xcode 6 beta 6