Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

get keyboard height swift

NotificationCenter.default.addObserver(
    self,
    selector: #selector(keyboardWillShow),
    name: UIResponder.keyboardWillShowNotification,
    object: nil
)
@objc func keyboardWillShow(_ notification: Notification) {
    if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
        let keyboardRectangle = keyboardFrame.cgRectValue
        let keyboardHeight = keyboardRectangle.height
    }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: swift dispatch queue 
Swift :: swift 5 only the day number from date 
Swift :: swift round double to 2 decimal places 
Swift :: how to call app delegate function in swift 
Swift :: and in swift 
Swift :: swift date difference in days 
Swift :: swift center label 
Swift :: swift 5 check if dictionary contains key 
Swift :: string to swift 2022 
Swift :: Module compiled with Swift 5.3 cannot be imported by the Swift 5.3.1 compiler 
Swift :: Swift Basic Input 
Swift :: swiftui create search bar 
Swift :: swift simulatore condition 
Swift :: swift image 
Swift :: xcode how to know which textfield is selected 
Swift :: swift create an empty array 
Swift :: Swift Nested function 
Swift :: swift check if array values are equal 
Swift :: Single Line Comment 
Swift :: swift enum storyboard 
Swift :: two integer value sum in swift 
Swift :: how to add dragdown gesture recognizer on view 
Swift :: Swift nested if Statement 
Swift :: swift increase int value 
Swift :: swift array chunks 
Swift :: Swift Print Variables and Strings together 
Swift :: swift concurrency datatask before ios 15 
Swift :: Swift String and Character Literals 
Swift :: caseiterable swift 
Swift :: Swift Create Multiple Objects of Class 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =