I have created a nice user interface, and I would like to add some accessibility to it.
In the settings menu I have added something like that

What I want from this is while I move the slider, the “A” character shown there it will increase/decrease in size. Also all the other fonts in the application will change size as well. I have created a global integer variable called “fontSizeVar” and all the fonts in my application take their font size value from there.
The problem is that I can not make this thing work. First of all it does not change dynamically the size of character “A”, and also it does not change the “fontSizeVar” and the text of the rest of the application.
Here is the action call
[self.fontSize addTarget:self
action:@selector(editFont)
forControlEvents:UIControlEventTouchDragInside];
Here is the action
-(IBAction)editFont{
[fontTesting setFont:[UIFont fontWithName:@"System" size:self.fontSize.value]];
fontSizeVar = self.fontSize.value;
}
Anyone has any idea how to make this work?
The trick is to use
UIControlEventValueChanged. Otherwise maybe only the first value is posted.Font sizes are of type
CGFloat, so no problem there. Perhaps try to go withsystemFontOfSize:instead offontWithName.