Core Layout #118

avaidyam opened this Issue Jun 13, 2012 · 7 comments


None yet
3 participants

Any plans to implement support for CoreLayout? (Cocoa's Auto Layout feature) I'll try to see if a clone would be possible to make life easier while working with TwUI.


joshaber commented Jun 13, 2012

I'd love it!

joshaber closed this Jun 13, 2012

joshaber reopened this Jun 13, 2012

In fact, I'll be slowly pushing more and more changes =____= I do believe my private TwUI fork has a lot more going for it than the public one, and it's about time I gave back xD

HAHA, AMAZING. Core Animation rocks. CAConstraintLayoutManager does most of the work internally. Now I'll work on adding AutoLayout-like features programmatically to the TUIView. Any way to support Interface Builder with this kit? :\

EDIT: We HAVE to bake this whole framework to support all of this: ASAP. I see why CoreAnimation is amazing now. And why it would take a LONG time to rewrite it.


jspahrsummers commented Jun 13, 2012

Note that Core Animation constraints are not the same as Cocoa Auto Layout. NSLayoutConstraint is implemented with a completely different engine from CAConstraint – notably, the latter is significantly less powerful, and doesn't support ASCII format strings.

Oh, I see, well I'll do some more research tonight and start trying to implement something to get it going.

EDIT: It does seem like a near one-to-one rewrite with newer features... Perhaps TwUI could have a TUILayoutConstraint object which wraps the CAConstraint with newer API features? I'll look into a design shortly.

Impressive. I find this quite intriguing. I'm about 60% done with a pretty good layout engine that DOESN'T rely on Core Animation. The only thing it lacks is the ASCII format strings, priorities, and boolean relations. However, those could be easily added in with the node-based view-detached logic I've got here. Expect something tomorrow :D

P.S. I'm testing on iOS, assuming TwUI is pretty much compatible with what I'm doing, so there may be a few glitches to iron out. Here's the code in the form of a TUIView category. is an example of its usage.
My private fork runs on manual memory management, so the gist needs to be converted to ARC.

avaidyam closed this Jun 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment