Currently, any view that wants to support subviews has to manually override a bunch of functions. This is error-prone. We should follow UIView's approach and support subviews in View directly. The only con is that it is harder to enforce that a view can only have 1 contentView, which is a requirement of HorizontalPanAndZoomView and VerticalScrollView.
Layout views should also forward subviews' desiredSize. This may require splitting of layoutSubviews and draw.
Currently, any view that wants to support subviews has to manually override a bunch of functions. This is error-prone. We should follow
UIView
's approach and support subviews inView
directly. The only con is that it is harder to enforce that a view can only have 1contentView
, which is a requirement ofHorizontalPanAndZoomView
andVerticalScrollView
.Layout views should also forward subviews'
desiredSize
. This may require splitting oflayoutSubviews
anddraw
.