Code Monkey home page Code Monkey logo

Comments (12)

nsomar avatar nsomar commented on June 28, 2024

Hey,

I think the main difference is that its written in swift, which means you will have to include libswiftcore.dylib and other swift libs when compiling your app.

Another main difference is in the way both project deals with changing settings, while in OAStackView performance was key (since you are going to use the stackview in complicated layouts). Changing axes and other settings will not cause the stack view to remove all the constraints.

In TZStackView changes will invalidate the constraints and add them again, this might affect performance badly for bigger, more complicated UIs.

Other differences are in the testing approaches both project uses, I have to say that testing constraint is the best approach, I will be moving the project test suite to constraints in the upcoming days.

from oastackview.

tomvanzummeren avatar tomvanzummeren commented on June 28, 2024

Thanks for the feedback ☺️

And sorry, I wasn't aware of this component when I created mine. I was participating WWDC when I heard about this new UIStackView and I was so enthusiastic about it that I decided to create it myself for earlier iOS versions.

But OAStackView has beaten me to the punch! I really did search for something similar when I started, but couldn't find anything!

Btw, another difference: I implemented all distribution options of the UIStackView, OAStackView did just do Fill and FillEqually. Also, just like with UIStackView, you can put subview.hidden = true inside an animation block and it will animate hiding/showing the subview. I implemented that as well with TZStackView

from oastackview.

harlanhaskins avatar harlanhaskins commented on June 28, 2024

It seems like TZStackView has more features implemented, but OAStackView is faster and has more recognition.

Maybe @tomvanzummeren should contribute back to OAStackView?

from oastackview.

nsomar avatar nsomar commented on June 28, 2024

@tomvanzummeren and @harlanhaskins The other distribution options have been introduced today by PR #8. the readme will be updated to reflect this addition soon.

I am not sure I understand the hiding argument, but OAStackView does indeed handle hiding the views, I didn't try, but setting a subview hidden inside a beginAnimation block should animate it as I only manipulate the layout constraints.

@tomvanzummeren and @harlanhaskins I am open to discus any contribution option guys :)

from oastackview.

tomvanzummeren avatar tomvanzummeren commented on June 28, 2024

Try it. Animating the hidden property of a subview doesn't just work out of the box. That's why it's mentioned in a separate part of the UIStackView docs.

But anyway, we both took different approaches. No use to contribute. OAStackView did it with performance in mind and is written in ObjC. Mine is in Swift and I decided performance is not important as you're not adding and removing subviews multiple times per second. I also can't imagine that UIStackView is doing it any differently. With TZStackView I focussed on having the exact same API and behaviour to be able to drop-in replace it with the real UIStackView and see no difference.

from oastackview.

tomvanzummeren avatar tomvanzummeren commented on June 28, 2024

And also:

I created TZStackView just because I wanted it for myself. This time I decided to share it with everyone by putting it on GitHub. I can take it down if it is not appreciated, but I won't contribute. It already took way too much of my spare time to create this one.

from oastackview.

nsomar avatar nsomar commented on June 28, 2024

@tomvanzummeren This is what happens when you hide a view inside an animation block
369f8e6eed

The change was to explicitly call layoutIfNeeded in the animation block.
I know that hidden is not animated, but OAStackView has KVO observation on the subviews, that will remove the view and rearrange the constraints accordingly.

from oastackview.

tomvanzummeren avatar tomvanzummeren commented on June 28, 2024

Well that's no good, is it? The red block disappears immediately. With the real UIStackView, it collapses before it disappears.

On Sun, Jun 21, 2015 at 6:56 PM, Omar Abdelhafith
[email protected] wrote:

@tomvanzummeren This is what happens when you hide a view inside an animation block
369f8e6eed

The change was to explicitly call layoutIfNeeded in the animation block.

Reply to this email directly or view it on GitHub:
#10 (comment)

from oastackview.

tomvanzummeren avatar tomvanzummeren commented on June 28, 2024

This is what I mean:

TZStackView hidden animation

I also implemented it with KVO.

from oastackview.

nsomar avatar nsomar commented on June 28, 2024

@tomvanzummeren oh, now I see, thanks, I will create an issue for that

from oastackview.

tomvanzummeren avatar tomvanzummeren commented on June 28, 2024

Oh wow, so I am contributing after all. Happy to help!

from oastackview.

nsomar avatar nsomar commented on June 28, 2024

@tomvanzummeren thanks for the help :) I will close this issue and open the another one.

from oastackview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.