In Messages.app you can dismiss the keyboard down by scrolling the list view. To be clear, it isn't simply responding to a scrollViewDidScroll
event. The keyboard tracks with your finger as you swipe down. Any idea how this is done?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
In the XCode, attributes inspector, the
scrollView
has aKeyboard
attribute. It has 3 options.Without tableview - yes it not a swipe but it doesn't the trick
Since iOS 7, you can use
From the documentation:
Since iOS7,
UIScrollView
and all classes that inherit from it (includingUITableView
) have akeyboardDismissMode
property. With Swift 3 and iOS 10,keyboardDismissMode
has the following declaration:Note that
UIScrollViewKeyboardDismissMode
is an enum that hasnone
,interactive
andonDrag
cases.#1. Set
UIScrollViewKeyboardDismissMode
programmaticallyThe code snippet below shows a possible implementation of
keyboardDismissMode
:#2. Set
UIScrollViewKeyboardDismissMode
in storyboardAs an alternative to the programmatic approach above, you can set the
UIScrollViewKeyboardDismissMode
value for yourUIScrollView
in the storyboard.UIScrollView
/UITableView
instance,If you're using a
tableView
and Swift 3 or Swift 4, it works by using: