Deprecate internal properties
klaaspieter opened this issue · 3 comments
Currently we expose properties for backgroundColor
, backgroundView
, stackView
, axis
seperatorViewFactory
and scrollView
. Ideally a user won't be able to modify the state of stackView
, seperatorViewFactory
and scrollView
without going through StackViewController
directly.
Being able to modify properties of the stack view directly makes it possible for a user to reconfigure it in such a way that it isn't compatible with the current configuration of the StackViewController
anymore. Similarly being able to change the axis
after initialization complicates the implementation of StackViewController
because it always needs to account for the fact the the axis might change.
axis
, separatorViewFactory
and backgroundView should be injected in the initializer and not changed after StackViewConroller
is initialized.
stackView
scrollView
properties that we want the user to modify should be exposed directly on the StackViewController
. For example if we want the user to be able to scroll we could expose scroll(toViewController:)
or scroll(toRect:)
on StackViewController
directly.
We can keep backgroundColor
, but I think it should be implemented as a convenience for backgroundView.backgroundColor =
.
I saw that these were deprecated in a few commits such as this one, but it is causing a lot of warnings to crop up when using StackViewController
as a dependency.
Those warnings should go away because the deprecated properties will be made (file)private
. Afaik there is no way to tell Xcode to only mark properties deprecated to the outside so unfortunately you'll get warnings if you build the project as part of your app's build process (CocoaPods does this).
Closed by 574aa6e