- Deprecated
<-
operator and the methods easy_clear
and easy_reload
in favour of
easy.layout
, easy.clear
and easy.reload
.
- Disabled
Enabled Code Coverage Support
for framework targets.
- Fixed macOS
EdgeInsets
type aliasing.
- In previous versions
Priority.highPriority
matched with UILayoutPriority.required
. This
version introduces a new Priority.required
case without breaking backwards compatibility as
old priorities have been marked as deprecated in favour of .low
, .medium
, .high
and
.custom
. Also .low
now has a Float
value of 250.0
instead of 1.0
.
- Fixed compilation error when
EASY_RELOAD
compiler flag is set.
- Now you can apply
DimensionAttributes
, like Width
, Height
and Size
,
to views not in the view hierarchy, i.e. when superview == nil
.
- Implemented
ContextualConditions
, a variant of the Condition
closures
where a Context
struct is passed as parameter to the closure providing some
extra information (size class and device) based on the UITraitCollection
of the UIView
the Attributes
are going to be applied to. Examples:
view <- [
Size(250),
Center(0)
].when { $0.isHorizontalRegular }
view <- [
Top(0),
Left(0),
Right(0),
Height(250)
].when { $0.isPad }
- Grouped deactivation of
NSLayoutConstraints
. Before, the deactivation of NSLayoutConstraints
was taking place upon finding
a conflict, whereas now a single NSLayoutConstraint.deactivateConstraints(_:)
takes place per <-
, easy_reload
or easy_clear
operation.
- Now it's possible to combine
multipliers
with Equal
, GreaterThatOrEqual
and LessThanOrEqual
relations.
// i.e.
Width(>=20*0.5) // value = 20, multiplier = 0.5, relation = .GreaterThanOrEqual
Width(<=20*0.5) // value = 20, multiplier = 0.5, relation = .LessThanOrEqual
Width(==20*0.5) // value = 20, multiplier = 0.5, relation = .Equal
- Improved performance, benchmarks show up to a 250% improvement applying
Attributes
with the apply operator <-
, resolving
conflicts and using easy_clear
and easy_reload
methods.
NSLayoutConstraint
conflict resolution is more accurate and strict.
- Added support to
NSLayoutGuide
.
- Supported tvOS and OS X.
- Added OS X sample project.
- Added support to
UIViewController
top and bottom layout guides that conform
the UILayoutSupport
protocol.
view <- [
Size(100),
CenterX(0),
Top(0).to(controller.topLayoutGuide)
]
Priorities
and Conditions
now can be easily applied to an Array
of Attributes
.
view <- [
Width(200),
Height(240)
].when { Device() == .iPad }
view <- [
Width(120),
Height(140)
].when { Device() == .iPhone }
- Added
UILayoutGuide
support (iOS 9 and above).
- Fixed bug clearing conflicting
Attributes
using easy_reload
.
- Apply operator
<-
returns the NSLayoutConstraints
created.
Constant
values of CGFloat
type.
- Optimized apply
<-
operation.
- Replaced
addConstraint
and removeConstraint
methods with activateConstraints
and deactivateConstraints
.
- Extended
UIView
with easy_clear()
, a method to clear the constraints applied
to the UIView
using EasyPeasy.
- Improved README file.