Autolayout resize button based on text and have textfield fill available space
Try these autolayout constraints:
Basically:
UITextField
object's width constraint should be aLess Than or Equal
relationUIButton
object's width constraint should be aGreater Than or Equal
relationUITextField
object's horizontalContent Hugging Priority
should be 249 (as per my constraint settings shown above)
And related code as:
[buttonObject setTitle:@"Button title is too... zzz" forState:UIControlStateNormal];
[buttonObject sizeToFit];
...or something along these lines