fix bugs in Swift newest version

fix bugs in Swift newest version