1

I have updated XCode to 13.0. And build my app. Now it is showing error as following

//MARK:- UberRide
class UberRide: NSObject {
var rideImgUrl: URL
var rideName: String
var ridePrice: Double = 0.0
var rideTime: String

   init(product: Product) {
       self.rideImgUrl = product.imageURL!
       self.rideName = product.name!
       if let price = product.priceDetails?.minimumFee {
        self.ridePrice = price
       }
       rideTime = ""
   }
}

Error is 'Product' is ambiguous for type lookup in this context and Type of expression is ambiguous without more contextenter image description here

How to fix it?

Nayan Dave
  • 1,078
  • 1
  • 8
  • 30
Minkle Garg
  • 723
  • 3
  • 9
  • 35

1 Answers1

1

Probably your type conflicts with new Product in StoreKit?

Check your imports. Do you need the full StoreKit there? You could also import only specific classes, thus preventing the conflict.

If you need to use both types in one file, you can always distinguish them by fully qualified name, e.g:

MyProject.Product or StoreKit.Product.

Sulthan
  • 128,090
  • 22
  • 218
  • 270