SwiftUI and SwiftData projects, textField gets focus, freezes, and takes 7000 milliseconds to focus

  1. macOS 14.5、Xcode 15.4、iPhone OS 18.0 beta

  2. Open Xcode and create a new project. Select swiftUI for Interface, Swift for Language, and Swiftdata for Storage.

  1. After creating the project, open the ContentView.swift file,write the code
@State var username: String = ""

TextField("info", text: $username)
                .textFieldStyle(.roundedBorder)
                .disableAutocorrection(true)
                .textInputAutocapitalization(.never)

  1. Run the project on iPhone. textField gets focus, freezes, and takes 7000 milliseconds to focus

SwiftUI and SwiftData projects, textField gets focus, freezes, and takes 7000 milliseconds to focus
 
 
Q