RotatingRecordModel

class RotatingRecordModel : ObservableObject

The model to observe RotatingRecord

  • Do we want to rotate or not?

    Declaration

    Swift

    private var rotate: Bool
  • Are we rotating or not?

    Declaration

    Swift

    @Published
    var rotating: Bool { get set }
  • A flip/flop when a rotation is completed

    Declaration

    Swift

    var status: Bool { get set }
  • The animation

    Declaration

    Swift

    var foreverAnimation: Animation { get }
  • startRotating() Asynchronous

    Start the rotating animation

    Declaration

    Swift

    @MainActor
    func startRotating() async
  • Stop the rotating animation

    Note

    the animation will only stop when the rotating is completed

    Declaration

    Swift

    func stopRotating()
  • The rotate animation

    Note

    A ‘GeometryEffect’ instead of a simple animation so we can observe it
    See more

    Declaration

    Swift

    struct Rotate : GeometryEffect, @unchecked Sendable