exyte / Macaw

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

Initializing with Dynamic Data #615

Closed ghost closed 4 years ago

ghost commented 5 years ago

When using super.init(...) to initialize a MacawView, it begins to create the node, etc. Using static data, this is fine. But is there a way to delay the instantiation when I need to wait for variables to finish assigning? (i.e. from a Firestore query)

ystrot commented 5 years ago

Hi Roy,

You can just initialize it with an empty node (Group()) and when you will be ready assign the correct value:

view.node = ...
PunkStarStudios commented 4 years ago

view.node? Where is the Node collection for the class found?

I have class MacawChartView: MacawView

And there is no .node exposed

ystrot commented 4 years ago

Here is MacawView.node. Probably you're doing something wrong if you can't access it.