RippleView

public class RippleView: UIView

A view with ripple animation

  • The radius of the disk in the view center, the default value is 5

    Declaration

    Swift

    @IBInspectable public var diskRadius: CGFloat = 5
  • The color of the disk in the view center, the default value is ripplePink color

    Declaration

    Swift

    @IBInspectable public var diskColor: UIColor = .ripplePink
  • The number of circles to draw around the disk, the default value is 3, if the forcedMaximumCircleRadius is used the number of drawn circles could be less than numberOfCircles

    Declaration

    Swift

    @IBInspectable public var numberOfCircles: Int = 3
  • The padding between circles

    Declaration

    Swift

    @IBInspectable public var paddingBetweenCircles: CGFloat = -1
  • The color of the off status of the circle, used for animation

    Declaration

    Swift

    @IBInspectable public var circleOffColor: UIColor = .rippleDark
  • The color of the on status of the circle, used for animation

    Declaration

    Swift

    @IBInspectable public var circleOnColor: UIColor = .rippleWhite
  • The minimum radius of circles, used to make space between the disk and the first circle, the radius must be grather than 5px , because if not the first circle will not be shown, the default value is 10, it’s recommanded to use a value grather than the disk radius if you would like to show circles outside disk

    Declaration

    Swift

    @IBInspectable public var minimumCircleRadius: CGFloat = 10
  • The duration of the animation, the default value is 0.9

    Declaration

    Swift

    @IBInspectable public var animationDuration: CGFloat = 0.9
  • The bounds rectangle, which describes the view’s location and size in its own coordinate system.

    Declaration

    Swift

    public override var bounds: CGRect
  • Initializes and returns a newly allocated view object with the specified frame rectangle.

    Declaration

    Swift

    override public init(frame: CGRect)

    Parameters

    frame

    The frame rectangle for the view, measured in points.

  • Initializes and returns a newly allocated view object from data in a given unarchiver.

    Declaration

    Swift

    required public init?(coder aDecoder: NSCoder)

    Parameters

    aDecoder

    An unarchiver object.

  • Lays out subviews.

    Declaration

    Swift

    override public func layoutSubviews()
  • Start the ripple animation

    Declaration

    Swift

    public func startAnimation()
  • Stop the ripple animation

    Declaration

    Swift

    public func stopAnimation()