exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.01k stars 553 forks source link

Added node search by predicate #718

Closed devpolant closed 4 years ago

devpolant commented 4 years ago

Intention

Updates

ystrot commented 4 years ago

Hi @AntonPoltoratskyi!

I think it's a good idea, however it would be better to have even more generic approach:

func nodeBy(predicate: (Node) -> Bool) -> Node?

func nodesBy(predicate: (Node) -> Bool) -> [Node]

Could you please update your PR so I can merge your work?

devpolant commented 4 years ago

Sure, I will push updates today or tomorrow

devpolant commented 4 years ago

Hi @ystrot ! I pushed updates

ystrot commented 4 years ago

Awesome, thank you! Merged it.