I have a subview that I want to keep stops during rotating screen, so I decided to put the NSLayoutConstraint type:
Trailing Space to Superview
Top Space to Supe
My trick is to simply declare a local variable that's just another pointer to the property, and put it in the NSDictionaryOfVariableBindings.
@interface ViewController ()
@property (strong) UIButton *myButton;
@property (strong) UILabel *myLabel;
@end
...
UIButton *myButtonP = self.myButton;
UILabel *theLabelP = self.myLabel;
NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(myButtonP, myLabelP);
The P suffix is for "pointer".