2.0.0
This release contains new features and backwards incompatible API changes.
Features
LayoutKit now supports:
- Animating between two different layouts (documentation)
- macOS and tvOS
- min/max height/width constraints on
SizeLayout - Incremental updates with
ReloadableViewLayoutAdapter
Backward incompatible changes
-
All base layout now expose a generic view parameter, similar to
SizeLayoutin 1.x.InsetLayout<V: UIView> LabelLayout<L: UILabel> SizeLayout<V: UIView> StackLayout<V: UIView>Subclasses of these layouts should use this generic parameter to customize the view created instead of overriding
makeView. -
Due to generic parameters, some nested types needed to be renamed
StackLayout.Distribution -> StackLayoutDistribution LabelLayout.TextType -> LabelLayoutTextType -
New
ConfigurableLayoutprotocol that all custom layouts should implement (instead of justLayout). -
Layoutprotocol'smakeViewfunction now requires aviewRecyclerparameter to support animations.ConfigurableLayoutprovides an implementation for this method. -
Layoutprotocol now requires aconfiguremethod. Previously creating a view and configuring it happened inmakeViewbut now it has been split into two functions.ConfigurableLayoutprovides an implementation for this method. -
Layoutprotocol now requires aviewReuseIdto help with animations and view reuse. -
PositioningLayoutis nowBaseLayout -
LayoutAxisrenamed toAxis -
Certain APIs have been updated to be consistent with Swift 3 style guidelines
makeViews(inView view: UIView) -> makeViews(in view: UIView) position(size size: CGSize, inRect rect: CGRect) -> position(size size: CGSize, in rect: CGRect) -
There are some new shim types to help support multiple platforms
View -> UIView or NSView Application -> UIApplication or NSApplication EdgeInsets -> UIEdgeInsets or NSEdgeInsets etc