To resolve the warning "Result of call to 'sink(receiveValue:) is unused`, create a variable of type "AnyCancellable?" and change the combine throttling method to:
self.cancellable = NotificationCenter.default.publisher(for: UITextField.textDidChangeNotification, object: searchTextField)
.debounce(for: .milliseconds(500), scheduler: RunLoop.main)
.sink { _ in
self.performLocalSearch()
}
Assigning that function to the cancellable variable causes the memory to be automatically deinitialized when the view is destroyed.