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