How do I prevent my text from displaying Optional() in the Swift interpolation?
My text displaying is :
---You can only switch properties once all images from Optional("PPP") have finished uploading.---
Here is my code
let imagesLeftToUpload = syncer!.imagesToUpload?.count
if(imagesLeftToUpload != nil && imagesLeftToUpload! > 0) {
let propertyConfig = syncer!.getPropertyConfig()
var propertyNameStr: String = ""
if(propertyConfig != nil && propertyConfig!.propertyName != nil) {
propertyNameStr = "from \(propertyConfig!.propertyName)"
}
messageText.text = "You can only switch properties once all images\(String(describing: propertyNameStr)) have finished uploading."
}