Eject icon indicating copy to clipboard operation
Eject copied to clipboard

Use Anchorage edge shorthand where possible

Open ZevEisenberg opened this issue 9 years ago • 3 comments

verticalAnchors, horizontalAnchors, and edgeAnchors should all be used if possible.

ZevEisenberg avatar Nov 21 '16 19:11 ZevEisenberg

Good idea! I think I may add an analysis pass after the CodeGenerators are populated in the XIBDocument. This could do the duplicate variable name detection, and coalesce ConstraintCodeGenerator to use the edge shorthands.

KingOfBrian avatar Nov 27 '16 20:11 KingOfBrian

Should be able to follow a pattern like this to scan statements for 2 or 4 matching generators and replace them with the compound anchors.

https://github.com/Raizlabs/Eject/blob/master/EjectKit/Builder/ActionBuilder.swift#L37

KingOfBrian avatar Nov 29 '16 06:11 KingOfBrian

Now we have centerAnchors as well.

ZevEisenberg avatar Mar 16 '17 18:03 ZevEisenberg