Does it still lag if you replace item.title.localizedCaseInsensitiveContains(searchQuery) with just item.title.contains(searchQuery)? Does it still lag if you build with optimizations turned on? (Don't leave it for debug after that, just to check if it lags on release builds). The .filter { _ in true } is unnecessary and certainly does not help especially in debug builds. If all that fails, yes you probably can turn off the animations using .animation(nil, value: searchQuery). Your other option would probably be a fast custom string search, something like KMP.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: