Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.searchable SwiftUI on IOS 17 cause an error: invalid numeric value

Simulator: iPhone 15 with IOS 17 Xcode: Version 15.0 (15A240d)

Simple example on just created project:

import SwiftUI

struct ContentView: View {
    @State private var searchText = ""

      var body: some View {
          NavigationStack {
              Text("Searching for \(searchText)")
                  .navigationTitle("Searchable Example")
          }
          .searchable(text: $searchText)
      }
}

#Preview {
    ContentView()
}

When start tapping any text throw:

Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem.

After clicking and canceling start show error below on every click:

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID

Does someone know how to fix?

I found a thread on apple forum https://developer.apple.com/forums/thread/731700, but as always no single answer from devs.

like image 258
Sever Avatar asked Jan 20 '26 02:01

Sever


1 Answers

That developer thread you linked had a suggestion to disable autocorrection. Seems to work in the meanwhile. Hopefully a fix comes through soon.

.autocorrectionDisabled()

like image 140
taboo Avatar answered Jan 21 '26 22:01

taboo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!