CB-6360 - improvement: feature detection instead of iOS version detection

This commit is contained in:
Shazron Abdullah 2014-04-17 16:52:21 -07:00
parent b9f8fcd8a9
commit c25bc30d7d

View File

@ -553,11 +553,14 @@
self.addressLabel.enabled = YES; self.addressLabel.enabled = YES;
self.addressLabel.hidden = NO; self.addressLabel.hidden = NO;
self.addressLabel.lineBreakMode = NSLineBreakByTruncatingTail; self.addressLabel.lineBreakMode = NSLineBreakByTruncatingTail;
if (IsAtLeastiOSVersion(@"6.0")) {
self.addressLabel.minimumScaleFactor = 10.0/[UIFont labelFontSize]; if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumScaleFactor:")]) {
} else { [self.addressLabel setValue:@(10.0/[UIFont labelFontSize]) forKey:@"minimumScaleFactor"];
self.addressLabel.minimumFontSize = 10.000; } else
if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumFontSize:")]) {
[self.addressLabel setValue:@(10.0) forKey:@"minimumFontSize"];
} }
self.addressLabel.multipleTouchEnabled = NO; self.addressLabel.multipleTouchEnabled = NO;
self.addressLabel.numberOfLines = 1; self.addressLabel.numberOfLines = 1;
self.addressLabel.opaque = NO; self.addressLabel.opaque = NO;