From c25bc30d7d1715b0cb945051cdf1866c6436f61f Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Thu, 17 Apr 2014 16:52:21 -0700 Subject: [PATCH] CB-6360 - improvement: feature detection instead of iOS version detection --- src/ios/CDVInAppBrowser.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m index aed735c..5253688 100644 --- a/src/ios/CDVInAppBrowser.m +++ b/src/ios/CDVInAppBrowser.m @@ -553,11 +553,14 @@ self.addressLabel.enabled = YES; self.addressLabel.hidden = NO; self.addressLabel.lineBreakMode = NSLineBreakByTruncatingTail; - if (IsAtLeastiOSVersion(@"6.0")) { - self.addressLabel.minimumScaleFactor = 10.0/[UIFont labelFontSize]; - } else { - self.addressLabel.minimumFontSize = 10.000; + + if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumScaleFactor:")]) { + [self.addressLabel setValue:@(10.0/[UIFont labelFontSize]) forKey:@"minimumScaleFactor"]; + } else + if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumFontSize:")]) { + [self.addressLabel setValue:@(10.0) forKey:@"minimumFontSize"]; } + self.addressLabel.multipleTouchEnabled = NO; self.addressLabel.numberOfLines = 1; self.addressLabel.opaque = NO;