Added #ifdef for iOS-specific code