title: How to handle an optional value associated with UILabel.text - swift
body: <p>I have a single view application.  The UIViewController uploads a file and a second UIViewController acts as a custom popup.  The first viewcontroller sends notifications on the progress of the upload to an observer in the popup.  My application crashes randomly in the second viewcontroller in the line indicated below.  I do not know how to handle the unwrapping of this options value</p>
  
  <p>custom popup UIViewController:</p>
  
  <pre><code>@IBOutlet weak var txtLabelOutlet: UILabel!
  
   override func viewDidLoad() {
      super.viewDidLoad()
  
      createUploadFinishObserver()
  }
  
  
   func createUploadObserver(){
      NotificationCenter.default.addObserver(forName: notifcationName, object: nil, queue: OperationQueue.main) { (notification) in
  
          guard
              var arrayN = notification.userInfo as? [String:Double],
              let num = arrayN["progress"] else{
                  print("no valid data")
                  return
          }
          // UPDATE PROGRESS BAR
          let progress = Float.init(num)
          self.progressOutlet.progress = progress
  
          // UPDATE LABEL
          let percent = Int(progress*100)
  
          if self.txtLabelOutlet.text != nil{
              self.txtLabelOutlet.text = "\(percent)%" // CRASHES HERE 'Fatal error: Unexpectedly found nil while unwrapping an Optional value'
          }
      }
  }
  </code></pre>