constraintsWIthVisualFormat accepts a dictionary of notes, but it should NOT be from NSDictionaryOfVariableBindings For example:
UILabel *label = self.label; NSDictionary *views = @{@"label":self.label, @"_textField":_textField}; [self.contentView addConstraints: [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[label(==_textField)][_textField(==label)]-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:views]];
I have not tested this, so please let me know if I have an order or syntax, so I can fix it, but the point of your dictionary can be arbitrary.
James source share