I have a relatively small native app that and would like to have a 3-button control that can set the font size application wide. I'd like it to be able to support clicking the different unfilled-in size and have it automatically rerender the current view with the new font size and all subsequent views. Similar to having a control where the filled-in size is the current size and the clear versions would be buttons that could be selected:
It would seem like I want to pogramaticaslly have Dynamic Type but I'm not sure if there is an easier way. Reading through the different Text technologies really hasn't provided much help.
My views use a combination of UILabels and UITextViews with NSAttributedString's and NSString's. What would be the best option to manage font size programatically?
thx for any help
edit 1
Here's a label that I would like to add; can I just update the _mainFont variable which is used in the subviews and tell those subviews to update their rendering?
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(10.0f, 10.0f, 100.0f, 20.0f)];
myLabel.backgroundColor = [UIColor blueColor];
[myLabel setUserInteractionEnabled:YES];
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
[recognizer setNumberOfTapsRequired:1];
//lblName.userInteractionEnabled = true; (setting this in Interface Builder)
[myLabel addGestureRecognizer:recognizer];
[tempScrollView addSubview:myLabel];
}
- (void)tapAction {
NSLog(@"Tap action");
_mainFont = MYLargerMainFont();
[self.view setNeedsDisplay];
//[self.view.subviews setNeedsDisplay];
}