In a class I created I have a struct called Image:
public struct Image {
private(set) var url: String
private(set) var crop: CGRect
init(url: String, crop: CGRect) {
self.url = url
self.crop = crop
}
}
I also have a function that usesImage as a parameter.
public func detectBoxes(image: Image) {
//some code
}
What I want to do is access Image in another file to use it in a function. So, I create an instance of the class and try typing
instance.detectBoxes(image: ...)
BUT it won't let me create an instance of Image so I can use it, it just wants me to type Class.Image which doesn't make sense.
Does anyone know how to solve my issue? Any help would be much appreciated. Cheers, Theo