0

I have tried other solution like this and this , but they don't help. I need a method to check the iOS version before using a function.

for the moment i have in MyObject.h

#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
- (UNNotificationContent *)getLocalNotificationForReminder:(Reminder *)reminder;
#else
- (UILocalNotification *)getLocalNotificationForReminder:(Reminder *)reminder;
#endif

and in MyObject.m:

    #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
            - (UNNotificationContent *)getLocalNotificationForReminder:(Reminder *)reminder{
         ....
         return notif;
        }
#else
            - (UILocalNotification *)getLocalNotificationForReminder:(Reminder *)reminder{
         ....
         return notif;
        }
#endif

My problem is that i run the app on device with iOS <10.x and the (UNNotificationContent *)getLocalNotificationForReminder:(Reminder *)reminder function is triggered that should be triggered when device have >=iOS10

Constantin Saulenco
  • 2,235
  • 1
  • 19
  • 43
  • i have mentioned that i have tried those solution, and what i need is other solution. But still "Thank you" for marking as duplicate. – Constantin Saulenco Oct 26 '17 at 05:20
  • Here you can get all info related to device over here https://github.com/aleemrazzaq/ARCompactDeviceInfo – Aleem Mar 29 '18 at 13:28

0 Answers0