DevTechie
Published in

DevTechie

New in SwiftUI 3: FocusState in SwiftUI 3 and iOS 15

@FocusState is a new property wrapper introduced in iOS 15 in conjunction with focused modifier. FocusState this property wrapper provides a way to read and write current focus positions within the view hierarchy.

The way this property wrapper works is when focus enters the view being modified, the wrapped value for the property wrapper updates to match a given prototype value and when focus leaves the view, wrapped value resets to false or nil. Depending upon the focus state you can take actions on entered data.

--

--

--

DevTechie.com is all about sharing knowledge by practical means. We focus on solving real world challenges via code.

Recommended from Medium

Path Animation in SwiftUI

App Coordinators for Dynamic User Interface Design

Animation in SwiftUI

A SwiftUI Tour

What’s new in Swift notes

LazyVGrid in SwiftUI

Swift Programming Language: Array Properties

AppStorage in SwiftUI

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
DevTechie

DevTechie

DevTechie creates tutorials at www.youtube.com/c/DevTechie. Also video courses on: www.udemy.com/user/devtechie/ and courses on: www.patreon.com/DevTechieInc

More from Medium

Circular Progress bar view in SwiftUI

Displaying Borders in SwiftUI

SwiftUI Learning Curve