Latest 1.1.1
License MIT
Platforms ios 8.0

[![CI Status]( Montserrat/AMGAutolayoutHelper.svg?style=flat)]( Montserrat/AMGAutolayoutHelper)


To run the example project, clone the repo, and run pod install from the Example directory first.



AMGAutolayoutHelper is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "AMGAutolayoutHelper"

How it works

AMGAutolayoutHelper works directly in interface builder. Just change the class of the UI elements (UILabel, UIButton, UITextField and UITextView) to the corresponding AMGAutolayout (AMGAutolayoutLabel, AMGAutolayoutButton, AMGAutolayoutField and AMGAutolayoutTextView).
This will make the font size adapt at screen width.

If you prefer to adapt the font size at screen height, change the Axis name (@IBInspectable) from default (or ‘horizontal’) to ‘vertical’

If you need to change it programmaticaly, you can get the calculations as follows:

let newSize = AMGAutolayoutHelper.shared.convertSize(size: 30.0)
let newSizeVertical = AMGAutolayoutHelper.shared.convertSize(size: 30.0, axis: .vertical)
let newSizeCustom = AMGAutolayoutHelper.shared.convertSize(size: 30.0, axis: .vertical, original: 500.0, final: 200.0)

By default, the original screen size (the screen size designed) is iPhone 6 (375.0 x 667.0). If you want to change it, you can do it by setting:

AMGAutolayoutHelper.shared.defaultWidth = 375.0
AMGAutolayoutHelper.shared.defaultHeight = 667.0

You can do it in application did finish launching.


Albert Montserrat, [email protected]


AMGAutolayoutHelper is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "AMGAutolayoutHelper",
    "version": "1.1.1",
    "summary": "Autolayout UI subclases to automatically adapt font sizes",
    "description": "This library add support to autolayout font sizes directly from Inspector Builder. Just configure the default width and height of the AMGAutolayoutHelper singleton and change the UI elements to the corresponding AMGAutolayout.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Albert Montserrat": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.1"
    "platforms": {
        "ios": "8.0"
    "source_files": "AMGAutolayoutHelper/Classes/**/*",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This