0

float 値 (UIFontSize) を NSUserDefaults で保存するには?

(void)pinchGesture:(UIPinchGestureRecognizer *)gestureRecognizer{NSLog(@"*** Pinch: Scale: %f Velocity: %f", gestureRecognizer.scale, gestureRecognizer.velocity);

UIFont *font = self.bioTextView.font;
CGFloat pointSize = font.pointSize;
NSString *fontName = font.fontName;

pointSize = ((gestureRecognizer.velocity > 0) ? 1 : -1) * 1 + pointSize;

if (pointSize < 13) pointSize = 13;
if (pointSize > 26) pointSize = 26;

self.bioTextView.font = [UIFont fontWithName:fontName size:pointSize];
4

1 に答える 1