Latest 0.1
Homepage https://github.com/mkral/UIFont-DynamicFontControlDemo
License MIT
Platforms ios
Authors

UIFont-DynamicFontSize

This category is meant to help with using the Dynamic Text sizes introduced in iOS7. I have put in checks to make sure user is running iOS7 or I just return the normal UIFont. You can use your own font and scale the size of the font.

Install Via Cocoapods:

pod 'UIFont-DynamicFontControl', '~> 0.1'

To Use:

Import Header File

#import "UIFont+DynamicFontControl.h"

Initialize a dynamic font with a UIFontTextStyle and a font name.

UIFont * dynamicFont = [UIFont preferredFontForTextStyle:UIFontTextStyleBody withFontName:@"AmericanTypewriter"];

Alternatively you can set your own scale value for the font size.

UIFont * scaledDynamicFont = [UIFont preferredFontForTextStyle:UIFontTextStyleBody withFontName:@"AmericanTypewriter" scale:2.0f];

Current Limitations

Right now the only attribute affected is the font size.For example I am not adding a BOLD attribute for UIFontTextStyleHeadline.

I plan to update this category to use CoreText to fix this in the near future.

Latest podspec

{
    "name": "UIFont-DynamicFontControl",
    "platforms": {
        "ios": null
    },
    "version": "0.1",
    "summary": "This category is meant to help with using the Dynamic Text sizes introduced in iOS7",
    "authors": {
        "Michael Kral": "[email protected]"
    },
    "homepage": "https://github.com/mkral/UIFont-DynamicFontControlDemo",
    "license": "MIT",
    "source": {
        "git": "https://github.com/mkral/UIFont-DynamicFontControlDemo.git",
        "tag": "0.1"
    },
    "source_files": "UIFont-DynamicFontControl/*.{h,m}",
    "requires_arc": false
}

Pin It on Pinterest

Share This