AutocompleteTextfieldSwift icon indicating copy to clipboard operation
AutocompleteTextfieldSwift copied to clipboard

Text doesn't autocomplete?

Open surayashivji opened this issue 9 years ago • 3 comments

I've implemented all that is required from this great add on, but for some reason, though the "autoCompleteStrings" appear in the table view for the text field, it doesn't actually autocomplete when I begin typing. is there a problem with my handleTextFieldInterfaces?

`private func handleTextFieldInterfaces() { self.chemicalAuto.onTextChange = {[weak self] text in

        print("Change")
        var keys = Array(DataSource.sharedManager.chemicalTable.keys)
        self!.chemicalAuto.autoCompleteStrings = keys
}

    self.chemicalAuto.onSelect =
    {
        [weak self] text, indexpath in

        print("select")
        var keys = Array(DataSource.sharedManager.chemicalTable.keys)
        self!.chemicalAuto.autoCompleteStrings = keys
    }
}`

surayashivji avatar Feb 13 '16 05:02 surayashivji

Hi @surayashivji , i wasn't able to replicate this issue. But I have updated the code for the latest swift version. Please try if this will work for you first. Thank you.

mnbayan avatar Mar 24 '16 10:03 mnbayan

I am having the same issue on my end.

wasimxyz avatar Jun 16 '16 05:06 wasimxyz

@surayashivji @wasimsandhu I cannot replicate this issue on my end. Autocomplete strings are showing on table view when assigning strings to the autoCompleteStrings property.

However as to what is wrong on @surayashivji 's code snippet above, on self.chemicalAuto.onSelect please remove the ff:

var keys = Array(DataSource.sharedManager.chemicalTable.keys)
self!.chemicalAuto.autoCompleteStrings = keys

because this asks the library to once again reload and display another set of autocomplete strings

mnbayan avatar Jul 03 '16 15:07 mnbayan