Open ZevEisenberg opened 7 years ago
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.
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
Now we have centerAnchors
as well.
verticalAnchors
,horizontalAnchors
, andedgeAnchors
should all be used if possible.