S.M_Emamian
S.M_Emamian

Reputation: 17383

'Index' is ambiguius for type lookup in this context

I'm using two libraries that have conflict to each other:

import DropDown
import SwiftyJSON

my code:

  self.dropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in
                guard let cell = cell as? MyCell else { return }

I get this error:

'Index' is ambiguius for type lookup in this context

I changed Indexto DropDown.Index but I got this error:

Index is not a member type of DropDown

Upvotes: 2

Views: 213

Answers (1)

Welton122
Welton122

Reputation: 1131

Index is not a valid type within your module or the DropDown module. Are you sure Index exists as a type? Maybe its type Int or IndexPath instead?

EDIT: Upon a second look, you can change this so the error is not a problem. In Swift, you dont need to specify the type information here as it can be inferred:

self.dropDown.customCellConfiguration = { index, item, cell in
    ...
}

Upvotes: 5

Related Questions