Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

High CPU usage #10

@Schlabbi

Description

@Schlabbi

When using the search bar I get a high CPU usage (100% usage consistently), even when the user has not interacted with the search bar or the app at all. I only tested this on iOS 14.2.1.

Here is an example of how the high CPU usage can be reproduced quite easily:

import SwiftUI
import SwiftlySearch

class SearchViewModel: ObservableObject {
    @Published var searchText = ""
}

struct ContentView: View {
    
    @ObservedObject var viewModel = SearchViewModel()
    
    var body: some View {
        NavigationView {
            List {
                Text("foo")
            }.navigationBarSearch($viewModel.searchText)
        }
    }
}

As soon as the .navigationBarSearch is commented out, the high CPU usage disappears.

Am I doing something wrong here or could this be a bug?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingconfirmedcriticalSomething is very wrong here

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions