0.3.0: Bool Me Over
0.3.0.mov
New in 0.3.0
Conditional Effects
Pow 0.3.0 introduces a new category of conditional effects that can be enabled or disabled through a boolean flag.
myView
.conditionalEffect(.smoke, condition: isEnabled)
myView
.conditionalEffect(.pushDown, condition: isEnabled)
Existing Change Effects can be used using the repeat modifier
myView
.conditionalEffect(.repeat(.jump(height: 100), every: 2), condition: hasUnreadMessages)
New Effects
Smoke
A Conditional Effect of smoke coming out the view.
Screen.Recording.2023-03-29.at.16.43.49.mov
myView
.conditionalEffect(.smoke, condition: isEnabled)
Glow
Emits a glow whenever a value changes.
glow.mov
myView
.changeEffect(.glow(color: .blue, radius: 50), every: 1.5), value: count)
Pulse
Emits a shape from the view.
pushdown.mov
let shape = RoundedRectangle(cornerRadius: 16, style: .continuous)
myView
.conditionalEffect(.pushDown, condition: isPressed)
.changeEffect(.pulse(shape: shape, drawingMode: .stroke, count: 3).delay(0.1), value: value)
Push Down
Scales and darkens a view to give it a recessed appearance.
pushdown.mov
myView
.conditionalEffect(.pushDown, condition: isPressed)
.changeEffect(.pulse(shape: shape, drawingMode: .stroke, count: 3).delay(0.1), value: value)
Wiggle
Shakes a view back and forth.
Screen.Recording.2023-03-29.at.16.58.50.mov
myView
.conditionalEffect(.repeat(.wiggle(rate: .fast), every: 2), condition: isCalling)
Updated Effects
- The
blur
transition now has a optional radius modifier. - The
vanish
transition now offers the ability to disable the increased brightness effect. - The
spin
Change Effect now takes an additionalrate
parameter that allows for faster spinning. - The
ping
Change Effect has been deprecated in favor ofpulse
with aPulseDrawingMode
of.fill
. - The
anvil
transition is now less susceptible to its particles clipping.