You will need three limitations here. One that maintains aspect ratio, one that ensures that the width is not greater than the maximum, and one that ensures that the height is not greater than the maximum. As of August 2016, Interface Builder does not support constraints that reference other constraints, so - at a minimum - aspect ratio constraints must be implemented in code.
- , . V_w V_h - . I_w I_h - . , , :

, :

, . . , MAX_HEIGHT MAX_WIDTH, . , iOS 9.0 . iOS, . .
[imageView.widthAnchor constraintEqualToAnchor:imageView.heightAnchor
multiplier:aspectRatioMult].active = YES;
[imageView.heightAnchor constraintLessThanOrEqualToConstant:MAX_HEIGHT].active = YES;
[imageView.widthAnchor constraintLessThanOrEqualToConstant:MAX_WIDTH].active = YES;
iOS 9.0 NSLayoutAnchor . NSLayoutConstraint.
CGFloat aspectRatioMult = (imageView.image.size.width / imageView.image.size.height);
[imageView addConstraint:
[NSLayoutConstraint constraintWithItem:imageView
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
toItem:imageView
attribute:NSLayoutAttributeHeight
multiplier:aspectRatioMult
constant:0]];
[imageView addConstraints:
[NSLayoutConstraint constraintsWithVisualFormat:@"V:[imageView(<=max)]"
options:0
metrics:@{@"max" : @(MAX_HEIGHT)}
views:@{@"imageView" : imageView}]];
[imageView addConstraints:
[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView(<=max)]"
options:0
metrics:@{@"max" : @(MAX_WIDTH)}
views:@{@"imageView" : imageView}]];