Open yo1995 opened 1 year ago
https://github.com/Esri/arcgis-maps-sdk-swift-samples/pull/182#discussion_r1205881553
I would argue that static methods are sometimes essential to declutter the initializer. Compared to static properties, they shouldn't be a huge problem as the memory footprint can be pretty small, just a pointer to a method vs the static properties object size.
While we are examining all static
and class
keywords for type methods/properties, most of the time we only need to fix the properties in question.
Criteria
In 200.0.0-beta, because we used the StateObject-for-map pattern, many view properties are created as type property, or gets their default value from a static method. This is not a memory efficient approach as many static properties will stay in the memory longer than desired.
Instead, we can move the static methods into the traditional initialization process, and make the properties instance properties instead of type properties. Most often seen with graphics and graphics overlays.
See "Using Computed Variable" in the contribution guideline for more details.