migrate code to swift xcode beta 7