Initializer

init(eventRef:)

Creates an event object that is based on a Carbon type of event.

Declaration

init?(eventRef: UnsafeRawPointer)

Parameters

eventRef

The EventRef opaque type to be associated with the created NSEvent object.

Return Value

An autoreleased NSEvent object corresponding to eventRef or nil if eventRef cannot be converted into an equivalent NSEvent object.

Discussion

This method is valid for all events. The created NSEvent object retains the EventRef object and is released when the NSEvent object is freed.

See Also