Created
August 27, 2023 07:59
-
-
Save mezhevikin/244132ed8228a176f8a8e98ed469ad66 to your computer and use it in GitHub Desktop.
scrollDismissesKeyboardImmediately for ios 15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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