iOS 15 have new property wrapper: @FocusState. This is exactly like a regular @State property, except it’s specifically designed to handle input focus in our UI.
In this tutorial we will get to know that how to hide keyboard or you can say how to work with the @FocusState in SwiftUI.
Here is the sample code for adding Done button in the Toolbar and hide keyboard on that button click.
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