LayoutKit is a fast view layout library for iOS, macOS, and tvOS.
LayoutKit is now safe to use in App Extensions (#48).
Fixes bug with LabelLayout when numberOfLines > 0 (#38)
This release contains new features and backwards incompatible API changes.
LayoutKit now supports:
SizeLayout
ReloadableViewLayoutAdapter
All base layout now expose a generic view parameter, similar to SizeLayout
in 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 ConfigurableLayout
protocol that all custom layouts should implement (instead of just Layout
).
Layout
protocol's makeView
function now requires a viewRecycler
parameter to support animations. ConfigurableLayout
provides an implementation for this method.
Layout
protocol now requires a configure
method. Previously creating a view and configuring it happened in makeView
but now it has been split into two functions. ConfigurableLayout
provides an implementation for this method.
Layout
protocol now requires a viewReuseId
to help with animations and view reuse.
PositioningLayout
is now BaseLayout
LayoutAxis
renamed to Axis
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
ReloadableViewLayoutAdapter is now public.
Open source!