sample code for swift programming