Tutorial details

Font Size Slider | App Code for Sale | Preview

Font Size Slider | iOS Tutorial

How to change and display the font size of text using a UISlider

Overview PAGE TOP

Reference: http://www.geekylemon.com/xcode-font-size-slider

In this tutorial i will be showing you how to change and display the font size of text using a UISlider


  • 1 Label
  • 1 UISlider

This feature is handy for apps that require the user to read text and enable some users to increase the text size if they find it too small to read or too big

ViewController.h PAGE TOP

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController {
IBOutlet UILabel *label;


ViewController.m PAGE TOP

@implementation ViewController

-(IBAction)Slider:(id)sender {
UISlider *slide = (UISlider *)sender;
int fonts = (int)(slide.value);
NSString *newtext = [NSString stringWithFormat:@"%d", fonts];
label.font = [UIFont systemFontOfSize:fonts];
label.text = newtext;


Make sure you connect the slider as Value Changed

Reference PAGE TOP


0 Comments Leave a comment

Please login in order to leave a comment.

Newest first

to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.