KarimEbrahemAbdelaziz / SwiftyMenu

Simple and Elegant Drop down menu for iOS 🔥💥
MIT License
577 stars 56 forks source link

Cannot assign value of type '[String]' to type '[SwiftyMenuDisplayable]' #26

Closed PacoPacoPakitor closed 3 years ago

PacoPacoPakitor commented 3 years ago

hi, when i tried the code as pic, but it's not work for me. can you help me?

image image

rursache commented 3 years ago

add this extension to your project

extension String: SwiftyMenuDisplayable {
    public var displayableValue: String {
        return self
    }

    public var retrievableValue: Any {
        return self
    }
}
KarimEbrahemAbdelaziz commented 3 years ago

@PacoPacoPakitor as @rursache mentioned in the comment. You have to make whatever type you want to add to SwiftyMeny conform to SwiftyMenuDisplayable. Thank you