Actually I dont have a working iOS device any longer to test with, but I changed the code to assume it is always running on iOS and ran it and it worked. So if it is nt working it means detection of iOS is failing, which is done with
Code:
!!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)