The #if flags will tell you if you’re compiling for the phone or the editor. However, when you switch platform to iOS in build settings (as you might do when preparing to make an iOS build), then the code will be compiled with #if UNITY_IPHONE being true. This is useful for making sure your iOS code doesn’t have bugs.
However, if you need to know what device you’re actually running on, then you can check the Application.platform variable (RuntimePlatform.IPhonePlayer would be the one for iOS). If you need to know more specifically whether it’s an iPhone or iPad, you can check the iPhone.generation variable.