fixed errors due to swift syntax changes

syntax updates related to swift language changes