v0.3.0
版本发布时间: 2023-04-27 04:53:44
EmergeTools/Pow最新发布版本:1.0.4(2024-05-20 02:48:46)
https://user-images.githubusercontent.com/212465/228640685-154d3b07-45f2-455a-9510-93d0952c4431.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.
https://user-images.githubusercontent.com/212465/228576254-d8e3e6aa-fac4-44b2-93ba-24d17a729749.mov
myView
.conditionalEffect(.smoke, condition: isEnabled)
Glow
Emits a glow whenever a value changes.
https://user-images.githubusercontent.com/212465/228574373-0c8744dc-a97e-44b0-a431-9b4b76883b9d.mov
myView
.changeEffect(.glow(color: .blue, radius: 50), every: 1.5), value: count)
Pulse
Emits a shape from the view.
https://user-images.githubusercontent.com/212465/228578808-bde25e53-ac46-4e9a-b5e3-da63e4584165.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.
https://user-images.githubusercontent.com/212465/228578808-bde25e53-ac46-4e9a-b5e3-da63e4584165.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.
https://user-images.githubusercontent.com/212465/228581193-a73bb498-d02a-49f1-b479-8eb60e9ed12f.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.