HKHumanDelegate
@objc
public protocol HKHumanDelegate
The optional delegate callback functions
-
Callback when the current animation is finished playing
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, animationComplete: Bool)
Parameters
view
the HKHuman object for this event
animationComplete
always true
-
Callback when a chapter has been loaded
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, chapterTransition: String)
Parameters
view
the HKHuman object for this event
chapterId
the ID of the chapter, for lookup in the chapters map
-
Callback when the scene metadata is accessible
Declaration
Swift
@objc optional func human(_ view: HKHuman, initScene: String)
Parameters
view
the HKHuman object for this event
initScene
the title of the loaded scene
Since
SDK 2.0 -
Callback when a Label has been created
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, labelCreated: String)
Parameters
view
the HKHuman object for this event
labelCreated
the ID of the Label
-
Callback when a Label has been destroyed
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, labelDestroyed: String)
Parameters
view
the HKHuman object for this event
labelDestroyed
the ID of the Label
-
Callback when a scene Label is selected by the user
Declaration
Swift
@objc optional func human(_ view: HKHuman, labelPicked: String)
Parameters
view
the HKHuman object for this event
labelPicked
the ID of the selected Label
Since
SDK 2.0.1 -
Callback when visibility of scene Labels has changed
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, labelsShown: Bool)
Parameters
view
the HKHuman object for this event
labelsShown
a boolean to indicate if the Labels are shown (true) or hidden (false)
-
Callback when the scene has completed loading
Declaration
Swift
@objc optional func human(_ view: HKHuman, modelLoaded: String)
Parameters
view
the HKHuman object for this event
modelLoaded
the title of the loaded scene
Since
SDK 2.0.1 -
Callback when a loading error has occurred
Declaration
Swift
@objc optional func human(_ view: HKHuman, modelLoadError: String)
Parameters
view
the HKHuman object for this event
modelLoadError
the title of the loaded scene
Since
SDK 2.0.5 -
Callback when an object has been deselected
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, objectDeselected: String)
Parameters
view
the HKHuman object for this event
objectId
the ID of the selected object
-
Callback when an object has been picked by the user
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, objectPicked: String, position: [Double])
Parameters
view
the HKHuman object for this event
objectId
the ID of the selected object
position
the world position (x,y,z) of the selected object
-
Callback when an object has been selected
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, objectSelected: String)
Parameters
view
the HKHuman object for this event
objectId
the ID of the selected object
-
Callback when visibility of scene objects has changed
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, objectsShown: [String : Bool])
Parameters
view
the HKHuman object for this event
objectsShown
a dictionary of object IDs and a boolean to indicate if the object is shown (true) or hidden (false)
-
Callback will fire when an answer or set of answers has been selected
Since
SDK 134.1Declaration
Swift
@objc optional func human(_ view: HKHuman, quizAnswerSelected: [String])
Parameters
quizAnswerSelected
AnswerIDs of the selected answers
-
Callback will fire when an answer or set of answers has been submitted
Since
SDK 134.1Declaration
Swift
@objc optional func human(_ view: HKHuman, quizAnswerSubmitted: HKQuizSubmission?)
Parameters
quizAnswerSubmitted
the HKSubmission object representing a submitted response to a question
-
Callback will fire when a Quiz has been completed
Since
SDK 134.1Declaration
Swift
@objc optional func human(_ view: HKHuman, quizCompleted: Double)
Parameters
quizCompleted
the user’s score on the quiz is returned
-
Callback will return true if the loaded content contains a Quiz
Since
SDK 134.1Declaration
Swift
@objc optional func human(_ view: HKHuman, quizEnabled: Bool)
Parameters
quizEnabled
the UIImage screenshot
-
Callback will fire when a Quiz has started
Since
SDK 134.1Declaration
Swift
@objc optional func human(_ view: HKHuman, quizEntered: Bool)
Parameters
quizEntered
will always return true
-
Callback will fire when a Quiz has been exited
Since
SDK 134.1Declaration
Swift
@objc optional func human(_ view: HKHuman, quizExited: Bool)
Parameters
quizExited
will always return true
-
Callback will fire when a Quiz Question has been loaded
Since
SDK 134.1Declaration
Swift
@objc optional func human(_ view: HKHuman, quizQuestionLoaded: String)
Parameters
quizQuestionLoaded
Question ID of the loaded question
-
Callback when a call to scene.restore() has completed successfully
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, sceneRestored: Bool)
Parameters
view
the HKHuman object for this event
sceneRestored
always true
-
Callback when the draw tool download button is pressed
Declaration
Swift
@objc optional func human(_ view: HKHuman, shareImage: UIImage)
Parameters
view
the HKHuman object for this event
shareImage
a png to share with the native UI
Since
SDK 2.1.0 -
Callback when a URL is shared from the viewer
Declaration
Swift
@objc optional func human(_ view: HKHuman, shareURL: String)
Parameters
view
the HKHuman object for this event
shareURL
a url to share with the native UI
Since
SDK 2.1.0 -
Callback when the current animation has updated
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, timelineUpdated: HKTimeline)
Parameters
view
the HKHuman object for this event
timelineUpdated
the updated timeline object
-
Callback when a xray mode is enabled or disabled
Since
SDK 2.0Declaration
Swift
@objc optional func human(_ view: HKHuman, xrayEnabled: Bool)
Parameters
view
the HKHuman object for this event
xrayEnabled
Boolean indicating true for xray enabled or false for xray disabled
-
Callback when a screenshot has been generated
Declaration
Swift
@objc optional func screenshot(image: UIImage)
Parameters
image
the UIImage screenshot