Contents

emitEvent(_:id:)

Marks a point of interest in time.

Declaration

func emitEvent(_ name: StaticString, id: OSSignpostID = .exclusive)

Parameters

  • name:

    The event’s name.

  • id:

    The event’s identifier. The default value is Exclusive.

Mentioned in

Discussion

You can use the makeSignpostID() and makeSignpostID(from:) methods to generate an identifier for the event, as the following example shows:

// Create a signposter using the default subsystem.
let signposter = OSSignposter()
        
// Generate a signpost ID to associate with the event.
let signpostID = signposter.makeSignpostID()
        
// Emit a named event using the signpost ID.
signposter.emitEvent("Example Event", id: signpostID)

See Also

Emitting Individual Signposts