Updated Swift code to use Swift types in certain cases