Firebase loads the file, getting an extra line in the file name

I used a sample Firebase friendly chat when uploading an image. Getting a response with an optional string. what is missing

Optional(FIRStorageMetadata 0x7fc84aced790: { bucket = "abc.appspot.com"; contentEncoding = identity; contentType = "image/jpeg"; downloadTokens = "abctoken"; generation = 1231231; metageneration = 1; name = "Optional(\"S5CKnKUykANdxSvZ3wujpMXHTvg1\")/494509700277/asset.JPG"; timeCreated = "2016-09-02T11:49:00.114Z"; updated = "2016-09-02T11:49:00.114Z"; }) 

My code is:

  let filePath = "(FIRAuth.auth()!.currentUser!.uid)/(Int(NSDate.time‌​IntervalSinceReferen‌​ceDate() * 1000))/(referenceUrl.lastPathComponent!)" 

was written with an extra value (?) in the sample, so I convert it (!)

0
ios firebase firebase-storage
source share
1 answer

In fast mode, you must force the value to expand to avoid this (but make sure it is not zero).

"\(optionalValue!)"

Or expand it in the standard way

 if let value = optionalValue { someFIRMethod("\(value)") } 
+1
source share

All Articles