Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swift2.x -> swift3.x autocomplete suggestions crashes in Swift3.x #115

Open
Nihonda opened this issue Jul 27, 2017 · 2 comments
Open

swift2.x -> swift3.x autocomplete suggestions crashes in Swift3.x #115

Nihonda opened this issue Jul 27, 2017 · 2 comments

Comments

@Nihonda
Copy link

Nihonda commented Jul 27, 2017

Dear Eddy Borja

Asynchronous managing of a drop down table of autocomplete suggestions crashes in Swift3.x

NSAssert(0, @"An autocomplete datasource must implement either autoCompleteTextField:possibleCompletionsForString: or autoCompleteTextField:possibleCompletionsForString:completionHandler:");
But same works perfectly in Swift 2.x.
Probably Apple change logics again. Please check.

It has been more than 2 years after update of your github repository.

Could you please address this issue.

Waiting so much, thank you

@FCZLumpy
Copy link

FCZLumpy commented Aug 1, 2017

func autoCompleteTextField(_ textField: MLPAutoCompleteTextField!, possibleCompletionsForString: String!, completionHandler handler: (([AnyObject]?) -> Void)!)
it works for me

@ericwastaken
Copy link

ericwastaken commented May 30, 2018

It appears that the Swift converter changes the signature in a way that causes the crash.

In my case, I was able to replace it with the below, which resolved the crash. Note, I'm already up to Swift 4.1 so this syntax might not be 3.x compatible (didn't check).

internal func autoCompleteTextField(_ textField: MLPAutoCompleteTextField!, possibleCompletionsFor string: String!) -> [Any]! {

    var result = [] as Array

    // YOUR LOGIC HERE TO POPULATE result

    // Return our result
    return result as [Any]

  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants