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
label.font = UIFont.preferredFontForTextStyle(UIFontTextStyleBody) |
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
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(didReceiveUIContentSizeCategoryDidChangeNotification:) | |
name:UIContentSizeCategoryDidChangeNotification object:nil]; |
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
- (void)didReceiveUIContentSizeCategoryDidChangeNotification:(NSNotification *)notification | |
{ | |
label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; | |
} |
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
NSNotificationCenter.defaultCenter().addObserver(self, | |
selector: "didReceiveUIContentSizeCategoryDidChangeNotification:", | |
name: UIContentSizeCategoryDidChangeNotification, object: nil) |
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
func didReceiveUIContentSizeCategoryDidChangeNotification(notification: NSNotification) | |
{ | |
label.font = UIFont.preferredFontForTextStyle(UIFontTextStyleBody) | |
} |
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
UIFontDescriptor *descriptorFontBody = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleHeadline]; | |
CGFloat descriptorFontBodySize = [userHeadLineFont pointSize]; | |
UIFont *bodyFont = [UIFont fontWithName:@"Zapfino" size:descriptorFontBodySize]; | |
label.font = bodyFont; |
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
let descriptorFontBody = UIFontDescriptor.preferredFontDescriptorWithTextStyle(UIFontTextStyleBody) | |
let descriptionFontBodySize = descriptorFontBody.pointSize; | |
let bodyFont = UIFont(name: "Zapfino", size: descriptionFontBodySize) | |
label.font = bodyFont; |
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
NSMutableArray *commands = [[NSMutableArray alloc] init]; | |
NSString *characters = @"`1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./"; | |
for (NSInteger i = 0; i < characters.length; i++) { | |
NSString *input = [characters substringWithRange:NSMakeRange(i, 1)]; | |
/* Caps Lock */ | |
[commands addObject:[UIKeyCommand keyCommandWithInput:input modifierFlags:UIKeyModifierAlphaShift action:@selector(handleCommand:)]]; | |
/* Shift */ | |
[commands addObject:[UIKeyCommand keyCommandWithInput:input modifierFlags:UIKeyModifierShift action:@selector(handleCommand:)]]; | |
/* Control */ |