MyGit

v0.3.0

EmergeTools/Pow

版本发布时间: 2023-04-27 04:53:44

EmergeTools/Pow最新发布版本:1.0.3(2023-12-16 13:04:03)

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


相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-04-27发行的版本