kimpro
kimpro

Reputation: 107

Cannot convert value of type 'Int' to expected argument type 'IndexSet'

for number in 0..<fetchResult.count{
    imgManager.requestImage(for: fetchResult.objects(at: number) as! PHAsset, targetSize: CGSize(width:200, height:200), contentMode: .aspectFill, options: requestOptions, resultHandler: {
    image, error in
        self.imageArray.append(image!)
    })
}

I have following error with number in fetchResult.objects(at:number)

cannot convert value of type 'Int' to expected argument type 'IndexSet'

How can I solve this problem?

Upvotes: 3

Views: 1347

Answers (1)

Laxman Sahni
Laxman Sahni

Reputation: 612

for number in fetchResult{
    imgManager.requestImage(for: number as! PHAsset, targetSize: CGSize(width:200, height:200), contentMode: .aspectFill, options: requestOptions, resultHandler: {
    image, error in
        self.imageArray.append(image!)
    })
}

Upvotes: 0

Related Questions