lockFocusIfCanDraw()
Locks the focus to the view atomically if the canDraw method returns true and returns the value of canDraw.
Declaration
func lockFocusIfCanDraw() -> BoolDiscussion
Your thread will not be preempted by other threads between the canDraw method and the lock. This method fails to lock focus and returns false, when the view is hidden and the current context is drawing to the screen (as opposed to a printing context).