Created
December 6, 2013 19:01
-
-
Save redent/7830297 to your computer and use it in GitHub Desktop.
Categories for specifying custom fonts in Interface Builder and Storyboard. More info here: http://stackoverflow.com/a/15155081/469218
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UILabel (TCCustomFont) | |
@property (nonatomic, copy) NSString* fontName; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "UILabel+TCCustomFont.h" | |
@implementation UILabel (TCCustomFont) | |
- (NSString *)fontName { | |
return self.font.fontName; | |
} | |
- (void)setFontName:(NSString *)fontName { | |
self.font = [UIFont fontWithName:fontName size:self.font.pointSize]; | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UITextField (TCCustomFont) | |
@property (nonatomic, copy) NSString* fontName; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "UITextField+TCCustomFont.h" | |
@implementation UITextField (TCCustomFont) | |
- (NSString *)fontName { | |
return self.font.fontName; | |
} | |
- (void)setFontName:(NSString *)fontName { | |
self.font = [UIFont fontWithName:fontName size:self.font.pointSize]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment