ios helper code