Instance Method

lockFocusIfCanDraw(in:)

Locks the focus to the view atomically if drawing can occur in the specified graphics context.

Declaration

func lockFocusIfCanDraw(in context: NSGraphicsContext) -> Bool

Parameters

context

The graphics context in which drawing might occur. See the discussion for the implications of the type of context.

Return Value

true if successful; otherwise, returns false.

See Also

Focusing

func lockFocus()

Locks the focus on the view, so subsequent commands take effect in the view’s window and coordinate system.

Deprecated
func lockFocusIfCanDraw() -> Bool

Locks the focus to the view atomically if the canDraw method returns true and returns the value of canDraw.

Deprecated
func unlockFocus()

Unlocks focus from the current view.

Deprecated
class var focusView: NSView?

Returns the currently focused NSView object, or nil if there is none.