behrad
behrad

Reputation: 646

ImageSlideshow pod getting error "Type of expression is ambiguous without more context"

i'm using zvonicek/ImageSlideshow pod in my project. when using AlamofireSource(urlString: "imageURL") inside setImageInputs function, i'm getting this error: Type of expression is ambiguous without more context

but when i'm using ImageSource(image: UIImage(named: "imageName")!) the error is gone. this error also happening for KingfisherSource(urlString: "imageURL") too. i'm installed 'ImageSlideshow/Alamofire' and 'ImageSlideshow/Kingfisher' pods but the problem still remainig.

Upvotes: 0

Views: 250

Answers (2)

mma7
mma7

Reputation: 306

Try to force unwarp the input Source like this,

slideShow.setImageInputs([
            KingfisherSource(urlString: "https://i.ytimg.com/vi/pbMEU4tp0S8/maxresdefault.jpg")!,
            KingfisherSource(urlString: "https://live.staticflickr.com/6221/6372557029_13b7d80ba9_b.jpg")!,
            KingfisherSource(urlString: "https://wallpaperaccess.com/full/2513892.jpg")!
        ])

It should work as setImageInuputs should get as a parameter an array [InputSource] and KingfisherSource conform to the InputSource protocol

Upvotes: 1

Preetika
Preetika

Reputation: 814

This type of error is generated when there is type mismatch. Please check the exact type required and pass that value only.

Upvotes: 1

Related Questions