Sever
Sever

Reputation: 2626

.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.

Upvotes: 16

Views: 6624

Answers (1)

taboo
taboo

Reputation: 11

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

.autocorrectionDisabled()

Upvotes: 1

Related Questions