티스토리 뷰
Call this method when you want the current object to be the first responder. Calling this method is not a guarantee that the object will become the first responder. UIKit asks the current first responder to resign as first responder, which it might not. If it does, UIKit calls this object's canBecomeFirstRespondermethod, which returns false by default. If this object succeeds in becoming the first responder, subsequent events targeting the first responder are delivered to this object first and UIKit attempts to display the object's input view, if any.
Never call this method on a view that is not part of an active view hierarchy. You can determine whether the view is onscreen, by checking its window property. If that property contains a valid window, it is part of an active view hierarchy. If that property is nil, the view is not part of a valid view hierarchy.
You can override this method in your custom responders to update your object's state or perform some action such as highlighting the selection. If you override this method, you must call super at some point in your implementation.
'macOS, iOS' 카테고리의 다른 글
Nil Coalescing Operator(Nil 병합 연산자) ?? (0) | 2019.07.04 |
---|---|
[Swift] Optional Binding (0) | 2019.07.04 |
swift의 정규 표현식 (0) | 2019.07.04 |
[Swift] Closure (0) | 2019.07.04 |
RxSwift Playground에서 써보기 (0) | 2019.07.04 |