Rightpoint/BonMot

Implement missing attributes in BONTextAlignmentConstraint

ZevEisenberg opened this issue · 5 comments

case BONConstraintAttributeFirstBaseline: // fall through
case BONConstraintAttributeLastBaseline: // fall through
case BONConstraintAttributeBottom: // fall through
case BONConstraintAttributeUnspecified: {
    [NSException raise:NSInternalInconsistencyException format:@"Not implemented yet"];
    break;
}

Well, are there any news for this?

@Domsware sorry, I haven't had a need for any of these attributes, so I haven't gotten around to implementing them. I'm curious - which attribute were you trying to use? And what's the design use case?

@ZevEisenberg
The use case is to display a numeric data composed of two subdatas: label + value.
Value is under the label with minimum vertical gap.

So I want to align .firstBaseline of label by top of value.

capture d ecran 2017-12-05 a 18 40 14

I think that's already supported by Auto Layout, without any help from BonMot:

value.topAnchor.constraint(equalTo: label.firstBaselineAnchor).isActive = true

Would this work for you?

Yes, it work.
Thank you