NSTextField Focus
<p>How to remove focus on NSTextField if I'm not focus in the textField?</p>

<p>I have a NSTextField and I set the Action: Sent On End Editing. After clicking the textField, the FOCUS will always in my NSTextField when I click other places on the view. 
Furthermore, I use <strong>makeFirstResponder</strong> and <strong>resignFirstResponder</strong> but all in vain. Any idea? </p> 

<pre><code>@IBAction func endOfEditing(sender: NSTextField) {
    view.window?.makeFirstResponder(nil)
    view.window?.resignFirstResponder()
}
</code></pre>

<p>For illustration, the FOCUS will always be in textField no matter where I pressed. (Even when I pressed the button)</p>

<p><a href="https://i.stack.imgur.com/MJ4oY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MJ4oY.png" alt="enter image description here"></a></p>

<p>How can I remove the focus when I click outside the textField?</p>

<p><a href="https://i.stack.imgur.com/yhWKj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yhWKj.png" alt="enter image description here"></a></p>