I have the following structure :
struct XFile : Codable {
...variables here
init(fileUrl: URL, key: String) {
...
}
Then in another class I am trying the following:
class UploadTask {
var xfile: XFile
var inProgress = false
init(file: URL) {
xFile = XFile(fileUrl: file, key: "filename")
}
}
If typed as above Xcode gives me the following error:
Cannot find 'xFile' in scope
If I remove the xFile= part,
Xcode give me the following warning and error:
Result of 'XFile' initializer is unused
Return from initializer without initializing all stored properties
Obviously I am breaking some rule, just not sure what it is.
Oh ****! The ‘f’! I kept looking at the ‘x’! Thank you. I seriously think I have a reading disorder sometimes.