Skip to content

Commit 45cb2b3

Browse files
committed
Add support to iOS 5 and lower
1 parent 80f1bc5 commit 45cb2b3

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

SIAlertView/SIAlertView.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,12 @@ - (CGFloat)heightForTitleLabel
703703
{
704704
if (self.titleLabel) {
705705
CGSize size = [self.title sizeWithFont:self.titleLabel.font
706-
minFontSize:self.titleLabel.font.pointSize * self.titleLabel.minimumScaleFactor
706+
minFontSize:
707+
#ifndef __IPHONE_6_0
708+
self.titleLabel.font.pointSize * self.titleLabel.minimumScaleFactor
709+
#else
710+
self.titleLabel.minimumFontSize
711+
#endif
707712
actualFontSize:nil
708713
forWidth:CONTAINER_WIDTH - CONTENT_PADDING_LEFT * 2
709714
lineBreakMode:self.titleLabel.lineBreakMode];
@@ -768,7 +773,11 @@ - (void)updateTitleLabel
768773
self.titleLabel.font = self.titleFont;
769774
self.titleLabel.textColor = self.titleColor;
770775
self.titleLabel.adjustsFontSizeToFitWidth = YES;
776+
#ifndef __IPHONE_6_0
771777
self.titleLabel.minimumScaleFactor = 0.75;
778+
#else
779+
self.titleLabel.minimumFontSize = self.titleLabel.font.pointSize * 0.75;
780+
#endif
772781
[self.containerView addSubview:self.titleLabel];
773782
#if DEBUG_LAYOUT
774783
self.titleLabel.backgroundColor = [UIColor redColor];

SIAlertViewExample/SIAlertViewExample.xcodeproj/project.pbxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@
341341
GCC_PRECOMPILE_PREFIX_HEADER = YES;
342342
GCC_PREFIX_HEADER = "SIAlertViewExample/SIAlertViewExample-Prefix.pch";
343343
INFOPLIST_FILE = "SIAlertViewExample/SIAlertViewExample-Info.plist";
344+
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
344345
PRODUCT_NAME = "$(TARGET_NAME)";
345346
WRAPPER_EXTENSION = app;
346347
};
@@ -352,6 +353,7 @@
352353
GCC_PRECOMPILE_PREFIX_HEADER = YES;
353354
GCC_PREFIX_HEADER = "SIAlertViewExample/SIAlertViewExample-Prefix.pch";
354355
INFOPLIST_FILE = "SIAlertViewExample/SIAlertViewExample-Info.plist";
356+
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
355357
PRODUCT_NAME = "$(TARGET_NAME)";
356358
WRAPPER_EXTENSION = app;
357359
};
@@ -376,6 +378,7 @@
376378
7E23C69717325EAB00784CF1 /* Release */,
377379
);
378380
defaultConfigurationIsVisible = 0;
381+
defaultConfigurationName = Release;
379382
};
380383
/* End XCConfigurationList section */
381384
};

0 commit comments

Comments
 (0)