ios fix from Stephen Blackheath; part of #7707