Instead of querying [UINavigationBar appearance]
for the selector, just
[UINavigationBar instancesRespondToSelector:@selector(shadowImage)]
an alternative solution may be checking the iOS version
if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending)
NSLog(@"iOS >= 7.0");