CameraButton

public class CameraButton : UIView, UIGestureRecognizerDelegate
extension CameraButton: CAAnimationDelegate

Camera ring view for capturing and recording state

  • Undocumented

    Declaration

    Swift

    public enum Constants

Properties

  • Camera button delegate

    Declaration

    Swift

    public weak var delegate: CameraButtonDelegate?
  • The minimum time for a hold to be considered “valid.” If the user holds and releases for a duration shorter than specified, the camera button will act as though it has been tapped instead of held.

    Declaration

    Swift

    public var minimumHoldDuration: TimeInterval
  • Line width for camera ring

    Declaration

    Swift

    public var ringWidth: CGFloat { get set }
  • List of allowed gestures to be used when recording a video(LongPressGesture) i.e. Double Tap Gesture, Pinch Gesture.

    Declaration

    Swift

    public var allowWhileRecording: [UIGestureRecognizer]
  • Ring color while recording

    Declaration

    Swift

    public var ringColor: UIColor? { get set }
  • Tap gesture recognizer that is used to recognize taps on the camera button to notify delegate that camera button was tapped to trigger an action (ie. capture)

    Declaration

    Swift

    public private(set) lazy var tapGestureRecognizer: UITapGestureRecognizer { get set }
  • Long press gesture recognizer used to handle recording gesture NOTE: this gets added to superview when the view is added, so that all touches can be passed through this view until the gesture is recognized in which it will then eat up all the touches

    Declaration

    Swift

    public private(set) lazy var pressGestureRecognizer: UILongPressGestureRecognizer { get set }

Init

  • Undocumented

    Declaration

    Swift

    public init()
  • Undocumented

    Declaration

    Swift

    public override init(frame: CGRect)
  • Undocumented

    Declaration

    Swift

    public required init?(coder: NSCoder)
  • Undocumented

    Declaration

    Swift

    public override func layoutSubviews()
  • Undocumented

    Declaration

    Swift

    public override var intrinsicContentSize: CGSize { get }

Gesture Recognizer

Animation

  • Start animating ring fill Call this function when gesture recognizer begins

    Declaration

    Swift

    public func startRecordingAnimation(
        ringFillDuration: TimeInterval = 10.0,
        maxRecordingDuration: TimeInterval = 60.0
    )

    Parameters

    ringFillDuration

    Duration of ring fill recording animation.

    maxRecordingDuration

    The max duration of a recorded video.

  • Stop animating ring fill and reset views to original state Call this function when gesture recognizer ends, cancels, or fails

    Declaration

    Swift

    public func stopRecordingAnimation()
  • Undocumented

    Declaration

    Swift

    public func animationDidStop(_ anim: CAAnimation, finished flag: Bool)