Skip to content

tejas-ardeshna/TJLayoutHelper

Repository files navigation

Codacy Badge Swift Version License Platform PRs Welcome

TJLayoutHelper

NSLayoutConstraint extension for pixel perfect designs

Features

  • Change constraint size according to device ratio
  • Change constraint value for specific device size

Requirements

  • iOS 10.0+
  • Xcode 8.0

Installation

Manually

Add TJLayoutHelper to your project

Programatically
@IBOutlet weak var consBlueViewTop: TJLayoutHelper!
func modifyConstraintAccordingToScreenSize()
{
   // Apply ratio
    consBlueViewTop.applyRatio   = true
    // OR add space for specific screen size
    consBlueViewTop.inch5_5Space = 20
    consBlueViewTop.XSpace       = 30
}
From story board

Alt Text

TODO

  • Add support for landscape orientation

Caution

Don't use apply ratio and extra space togather

Contribute

We would love you for the contribution to TJLayoutHelper, check the LICENSE file for more info.

Author

Tejas Ardeshna – @tejas_ardeshna, iOS developer at Simform solutoions PVT. LTD.

Distributed under the MIT license. See LICENSE for more information.