code for swift