Lyt for iOS

Download Source

A UIView category to make autolayout (more) readable and less verbose. Write this:

[view lyt_centerInParent];

Instead of:

NSLayoutConstraint *centerXConstraint = [NSLayoutConstraint
    constraintWithItem:view attribute:NSLayoutAttributeCenterX
    relatedBy:NSLayoutRelationEqual toItem:view.superview
    attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0];

[view.superview addConstraint:centerXConstraint];

NSLayoutConstraint *centerYConstraint = [NSLayoutConstraint
    constraintWithItem:view
    attribute:NSLayoutAttributeCenterY
    relatedBy:NSLayoutRelationEqual toItem:view2
    attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:0];

[view.superview addConstraint:centerYConstraint];

License: Apache 2.0

Language: Objective-C

Platform: iOS

Sponsored with ❤️ by Instabug
Why do mobile-first companies choose Instabug over Crashlytics
Instabug

Instabug helps you identify and resolve severe crashes quickly. You can retrace in-app events and know exactly which line of code caused the crash along with environment details, network logs, repro steps, and the session profiler. Ask more questions or keep users up-to-date with in-app replies straight from your dashboard. We take data privacy seriously, so no one sees your data but you!