HKTimeline

@objc
public class HKTimeline : NSObject

Timeline object

  • The current animation time

    Declaration

    Swift

    @objc
    public var currentTime: Float
  • The current animation duration

    Declaration

    Swift

    @objc
    public var duration: Float
  • The current scene is animated, true or false

    Declaration

    Swift

    @objc
    public var playing: Bool
  • The currently loaded Chapter to access title and description

    Declaration

    Swift

    @objc
    public var currentChapter: HKChapter?
  • A map of chapter IDs to HKChapter objects.

    Declaration

    Swift

    @objc
    public var chapters: [String : HKChapter]
  • An ordered list of chapter IDs

    Declaration

    Swift

    @objc
    public var chapterList: [String]

Timeline

  • Play the current scene’s animation from the beginning

    Declaration

    Swift

    @objc
    public func play()
  • Pause the current scene’s animation

    Declaration

    Swift

    @objc
    public func pause()
  • Unpause the current scene’s animation

    Declaration

    Swift

    @objc
    public func unpause()
  • Jump to the current module’s next chapter

    Declaration

    Swift

    @objc
    public func nextChapter()
  • Jump to the current module’s previous chapter

    Declaration

    Swift

    @objc
    public func prevChapter()
  • Jump to the chapter with the given chapterID

    Declaration

    Swift

    @objc
    public func moveToChapter(chapterID: String)
  • Jump to the given time in the current scene’s current animation

    Declaration

    Swift

    @objc
    public func moveToTime(time: Float)

    Parameters

    time

    animation offset in seconds

  • Jump to the chapter with the given chapterID and play the animation in a loop

    Since

    SDK 2.0

    Declaration

    Swift

    @objc
    public func loop(chapterId: String)