mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-27 13:40:41 +00:00
fixed deprecation warning for NSString UIKit Constants with iOS6 deployment target
This commit is contained in:
parent
bafd9a0fff
commit
eefa48846a
@ -90,7 +90,7 @@
|
||||
self.labelText = [[BITAttributedLabel alloc] init];
|
||||
self.labelText.font = [UIFont systemFontOfSize:TEXT_FONTSIZE];
|
||||
self.labelText.numberOfLines = 0;
|
||||
self.labelText.textAlignment = UITextAlignmentLeft;
|
||||
self.labelText.textAlignment = kBITTextLabelAlignmentLeft;
|
||||
self.labelText.dataDetectorTypes = UIDataDetectorTypeAll;
|
||||
}
|
||||
return self;
|
||||
@ -162,11 +162,11 @@
|
||||
[self.labelTitle setFrame:CGRectMake(FRAME_SIDE_BORDER, FRAME_TOP_BORDER + LABEL_TITLE_Y, self.frame.size.width - (2 * FRAME_SIDE_BORDER), LABEL_TITLE_HEIGHT)];
|
||||
|
||||
if (_message.userMessage) {
|
||||
self.labelTitle.textAlignment = UITextAlignmentRight;
|
||||
self.labelText.textAlignment = UITextAlignmentRight;
|
||||
self.labelTitle.textAlignment = kBITTextLabelAlignmentRight;
|
||||
self.labelText.textAlignment = kBITTextLabelAlignmentRight;
|
||||
} else {
|
||||
self.labelTitle.textAlignment = UITextAlignmentLeft;
|
||||
self.labelText.textAlignment = UITextAlignmentLeft;
|
||||
self.labelTitle.textAlignment = kBITTextLabelAlignmentLeft;
|
||||
self.labelText.textAlignment = kBITTextLabelAlignmentLeft;
|
||||
}
|
||||
|
||||
[self addSubview:self.labelTitle];
|
||||
|
@ -377,7 +377,7 @@
|
||||
cell.textLabel.textColor = DEFAULT_TEXTCOLOR;
|
||||
cell.accessoryType = UITableViewCellAccessoryNone;
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
cell.textLabel.textAlignment = UITextAlignmentCenter;
|
||||
cell.textLabel.textAlignment = kBITTextLabelAlignmentCenter;
|
||||
}
|
||||
|
||||
cell.textLabel.text = [NSString stringWithFormat:BITHockeyLocalizedString(@"HockeyFeedbackListLastUpdated"),
|
||||
@ -474,7 +474,7 @@
|
||||
|
||||
statusLabel.font = [UIFont systemFontOfSize:10];
|
||||
statusLabel.textColor = DEFAULT_TEXTCOLOR;
|
||||
statusLabel.textAlignment = UITextAlignmentCenter;
|
||||
statusLabel.textAlignment = kBITTextLabelAlignmentCenter;
|
||||
statusLabel.backgroundColor = DEFAULT_BACKGROUNDCOLOR;
|
||||
statusLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
|
||||
|
@ -230,7 +230,7 @@
|
||||
textField.backgroundColor = [UIColor whiteColor];
|
||||
textField.autocorrectionType = UITextAutocorrectionTypeNo;
|
||||
textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
|
||||
textField.textAlignment = UITextAlignmentLeft;
|
||||
textField.textAlignment = kBITTextLabelAlignmentLeft;
|
||||
textField.delegate = self;
|
||||
textField.tag = indexPath.row;
|
||||
|
||||
|
@ -185,7 +185,7 @@
|
||||
|
||||
- (CGSize)sizeThatFits:(CGSize)size {
|
||||
CGSize constr = (CGSize){.height = self.frame.size.height, .width = BIT_MAX_WIDTH};
|
||||
CGSize newSize = [self.buttonData.label sizeWithFont:self.titleLabel.font constrainedToSize:constr lineBreakMode:UILineBreakModeMiddleTruncation];
|
||||
CGSize newSize = [self.buttonData.label sizeWithFont:self.titleLabel.font constrainedToSize:constr lineBreakMode:kBITLineBreakModeMiddleTruncation];
|
||||
CGFloat newWidth = newSize.width + (BIT_PADDING * 2);
|
||||
CGFloat newHeight = BIT_MIN_HEIGHT > newSize.height ? BIT_MIN_HEIGHT : newSize.height;
|
||||
|
||||
|
@ -518,7 +518,7 @@
|
||||
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:frame];
|
||||
label.text = message;
|
||||
label.textAlignment = UITextAlignmentCenter;
|
||||
label.textAlignment = kBITTextLabelAlignmentCenter;
|
||||
label.numberOfLines = 2;
|
||||
label.backgroundColor = [UIColor clearColor];
|
||||
|
||||
|
@ -104,3 +104,20 @@ __VA_ARGS__ \
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
|
||||
|
||||
#define kBITTextLabelAlignmentCenter UITextAlignmentCenter
|
||||
#define kBITTextLabelAlignmentLeft UITextAlignmentLeft
|
||||
#define kBITTextLabelAlignmentRight UITextAlignmentRight
|
||||
#define kBITLineBreakModeMiddleTruncation UILineBreakModeMiddleTruncation
|
||||
|
||||
#else
|
||||
|
||||
#define kBITTextLabelAlignmentCenter NSTextAlignmentCenter
|
||||
#define kBITTextLabelAlignmentLeft NSTextAlignmentLeft
|
||||
#define kBITTextLabelAlignmentRight NSTextAlignmentRight
|
||||
#define kBITLineBreakModeMiddleTruncation NSLineBreakByTruncatingMiddle
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user