Skip to content

Commit

Permalink
Fix unguarded unavaiability warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlutsenko committed Dec 27, 2017
1 parent 3073412 commit 0caacd8
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions Bolts/iOS/BFWebViewAppLinkResolver.m
Original file line number Diff line number Diff line change
Expand Up @@ -237,26 +237,17 @@ - (BFAppLink *)appLinkFromALData:(NSDictionary *)appLinkDict destination:(NSURL
NSMutableArray *linkTargets = [NSMutableArray array];

NSArray *platformData = nil;
switch (UI_USER_INTERFACE_IDIOM()) {
case UIUserInterfaceIdiomPad:
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIPadKey] ?: @{},
appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
break;
case UIUserInterfaceIdiomPhone:
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIPhoneKey] ?: @{},
appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
break;
#ifdef __TVOS_9_0
case UIUserInterfaceIdiomTV:
#endif
#ifdef __IPHONE_9_3
case UIUserInterfaceIdiomCarPlay:
#endif
case UIUserInterfaceIdiomUnspecified:
default:
// Future-proofing. Other User Interface idioms should only hit ios.
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
break;

const UIUserInterfaceIdiom idiom = UI_USER_INTERFACE_IDIOM();
if (idiom == UIUserInterfaceIdiomPad) {
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIPadKey] ?: @{},
appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
} else if (idiom == UIUserInterfaceIdiomPhone) {
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIPhoneKey] ?: @{},
appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
} else {
// Future-proofing. Other User Interface idioms should only hit ios.
platformData = @[ appLinkDict[BFWebViewAppLinkResolverIOSKey] ?: @{} ];
}

for (NSArray *platformObjects in platformData) {
Expand Down

0 comments on commit 0caacd8

Please sign in to comment.