Some layout helper functions (UIView extension). Help to setup UIView width, height, center in its superview, left and right padding/ margin, top and bottom layout guide / safe area.
Before setup UI programmatically, remember always set:
uiview.translatesAutoresizingMaskIntoConstraints = false
If you used to do autolayout use storyboard, and want to try programmatically set UI Layout, this project may help you to start knowing how to set things up. Hope you find to the according operation from storyboard to code. If any weird bugs in layout show up in console, recommand a great tool: https://www.wtfautolayout.com/ -- Why The Failure Auto Layout?
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 10.0 or newer version. Swift 4.
QLayoutor is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'QLayoutor'
Zefeng Qiu (Will), z9qiu@uwaterloo.ca
QLayoutor is available under the MIT license. See the LICENSE file for more info.