Skip to content

Instantly share code, notes, and snippets.

@mezhevikin
Created August 27, 2023 07:59
Show Gist options
  • Save mezhevikin/244132ed8228a176f8a8e98ed469ad66 to your computer and use it in GitHub Desktop.
Save mezhevikin/244132ed8228a176f8a8e98ed469ad66 to your computer and use it in GitHub Desktop.
scrollDismissesKeyboardImmediately for ios 15
import SwiftUI
extension View {
@ViewBuilder func scrollDismissesKeyboardImmediately() -> some View {
if #available(iOS 16.0, *) {
self.scrollDismissesKeyboard(.immediately)
} else {
self
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment