Skip to content

evgenyneu/bubble-button-animation-ios-swift

Repository files navigation

Bubble button animation demo iOS app

This demo app shows how to apply spring style animation to a button.

Animation is done by setting Scale transform to the button inside animation block. This demo app allows to tweak duration, damping and velocity parameters of the animation function.

button.transform = CGAffineTransform(scaleX: 0.1, y: 0.1)

UIView.animate(withDuration: 2.0,
  delay: 0,
  usingSpringWithDamping: 0.2,
  initialSpringVelocity: 6.0,
  options: .allowUserInteraction,
  animations: { [weak self] in
    self?.button.transform = .identity
  },
  completion: nil)

Button animation iOS

iOS animate button demo with Swift

Credit

The Large Bubble Sound clip is taken from soundbible.com and recorded by snottyboy.

About

Demo iOS app showing button animation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages