Updated iOS code