Hi,  

or you can use visual format, which is much shorter …

  NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings( _firstLabel, 
_secondLabel );
  [self addConstraints:[NSLayoutConstraint 
constraintsWithVisualFormat:@"V:[_firstLabel(>=16)]-16-[_secondLabel(>=16)]"
                                                               options:0
                                                               metrics:nil
                                                                 
views:viewsDictionary]];

… or look at some of my macros …

https://github.com/robertvojta/mDevCamp-2013/blob/master/Auto%20Layout%20Demo/TMAutoLayout.h

… and your code can be much shorter …

  TMALVariableBindingsAMNO( _firstLabel, _secondLabel );
  TMAL_ADD_VISUAL( self.view, @"V:[_firstLabel(>=16)]-16-[_secondLabel(>=16)]" 
);


R.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to