oleksii-demedetskyi / Parus

Parus is simple chain style auto-layout helper for objective-c.
MIT License
106 stars 4 forks source link

Lib should allow user to add VFL constratints set. #6

Closed oleksii-demedetskyi closed 11 years ago

oleksii-demedetskyi commented 11 years ago

Next chains are allowed:

VFL --> options --> metrics --> views
VFL --> options --> metrics
VFL --> options --> views
VFL --> options
VFL --> metrics --> views
VFL --> metrics
VFL --> views
VFL

if views not stetted, than registerViews() should be used.

oleksii-demedetskyi commented 11 years ago

Also we need think about registerMetrics() block. This can be useful for constant fixing.

Forsarion commented 11 years ago

@DAlOG Not sure how registerViews() and registerMetrics() could be implemented - will we need to parse VFL?

oleksii-demedetskyi commented 11 years ago

@AndreyMoskvin we have next syntax in native imll

NSArray* constraints = f(vfl, options, metrics, views);

metrics and views are more stable.So we can reuse it from vfl to vfl. \

oleksii-demedetskyi commented 11 years ago

Due to syntax change we need support next type of call: NSArray* array = PVVFL(@"[view]-[view2]").#options#.withViews(#default dictionary macros#).metrics(#Dictionary#).asArray;

oleksii-demedetskyi commented 11 years ago

Or add asVFL property to NSString class. Method should return PVVFL(string) call result.

Forsarion commented 11 years ago

@DAlOG @xNekOIx Do you any VFL constraints that could be used without views specified?

I don't :)

xNekOIx commented 11 years ago

@AndreyMoskvin Me too. So far they shouldn't be optional, I think.

Forsarion commented 11 years ago

Current VFL order: vfl -> alignment(optional) -> direction(optional) -> withViews(required) -> metrics(optional)

oleksii-demedetskyi commented 11 years ago

Why withViews() is required? We can use vfl without any options inside a group. withViews() is required only for asArray finisher.

Forsarion commented 11 years ago

I've mentioned case when we need to create single VFL and return it as array of constraints - that's why it is required.

In case of group we will specify views and metrics later, am I right?

oleksii-demedetskyi commented 11 years ago

yes.

oleksii-demedetskyi commented 11 years ago

I think this feature is done.