You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/Signal/src/util/UIButton+OWS.m

26 lines
958 B
Matlab

//
// UIFont+OWS.m
// Signal
//
// Created by Christine Corbett Moran on 2/10/15.
// Copyright (c) 2013 Open Whisper Systems. All rights reserved.
//
#import "UIButton+OWS.h"
#import "UIFont+OWS.h"
#import "UIColor+OWS.h"
@implementation UIButton (OWS)
+ (UIButton*) ows_blueButtonWithTitle:(NSString*)title {
NSDictionary* buttonTextAttributes = @{NSFontAttributeName:[UIFont ows_regularFontWithSize:15.0f],
NSForegroundColorAttributeName:[UIColor ows_materialBlueColor]};
UIButton* button = [[UIButton alloc] init];
NSMutableAttributedString *attributedTitle = [[NSMutableAttributedString alloc] initWithString:title];
[attributedTitle setAttributes:buttonTextAttributes range:NSMakeRange(0, [attributedTitle length])];
[button setAttributedTitle:attributedTitle forState:UIControlStateNormal];
[button.titleLabel setTextAlignment:NSTextAlignmentCenter];
return button;
}
@end