Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not sure what ui behavior you are exactly looking for since it appears that you are trying to tie the leading space of your view to the leading space of it's superview. Being the leading space, the space on the left of the view, could it be that you are looking for the more common "stick my left side 100 pixels from my parents left border"? Anyway, in either case, I would connect an outlet from the controller to the custom view (i.e. myCustomView below) and then build the constraint in the UIViewController and not the UIView by overriding:</p> <pre><code>- (void)updateViewConstraints { [super updateViewConstraints]; NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:myCustomView attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:myCustomView.superview attribute:NSLayoutAttributeLeading multiplier:1 constant:100]; [myCustomView addConstraint:constraint]; } </code></pre> <p>Apple has an interesting page with a table showing the various runtime entry points for autolayout at this address: <a href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Articles/runtime.html#//apple_ref/doc/uid/TP40010853-CH6-SW1" rel="nofollow">https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Articles/runtime.html#//apple_ref/doc/uid/TP40010853-CH6-SW1</a></p> <p>You might consider adding other constraints as well. Auto layout has the the tendency to exploit any freedom you leave unchecked in the worst possible way ;-)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload