title: Show UIView/UIImage/UITextView while function is running
body: <h2>OBJECTIVE</h2>
  
  <p>I am trying to display a UIView, UIImage, and UITextView when a function is running in order to let a user know it is processing (similar to an Activity Indicator, but more customized).  </p>
  
  <h2>PROBLEM</h2>
  
  <p>When the code below is processing, the UIView, UIImage, and UITextView don't display until a moment before the function <strong>finishes</strong> running (instead of <strong>showing</strong> as soon the function <strong>starts</strong> running and <strong>hiding</strong> when the function <strong>finishes</strong>).</p>
  
  <h2>CURRENT APPROACH:</h2>
  
  <p>I have created a UIView (loadingView) which contains and image (loadingIcon) and a textView (loadingText) explaining to the user that the app is processing.</p>
  
  <p>I have also created a function called isLoading, which displays or hides all 3, rather than repeating these lines multiple times.  I have tested setting isLoading to true and false in the viewDidLoad to make sure that it is working properly.  </p>
  
  <pre><code>@IBOutlet weak var loadingView: UIView!
  @IBOutlet weak var loadingIcon: UIView!
  @IBOutlet weak var loadingText: UIView!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      isLoading(false)
  }
  
  
  func isLoading(_ loadStatus: Bool) {
      if loadStatus == true {
          loadingView.isHidden = false
          loadingIcon.isHidden = false
          loadingText.isHidden = false
      } else {
          loadingView.isHidden = true
          loadingIcon.isHidden = true
          loadingText.isHidden = true
      }
  }
  
  @IBAction func sendButtonPressed(_ sender: AnyObject) {
      isLoading(true)
  
      ... //process information, which takes some time
  
      isLoading(false)
  }
  </code></pre>
  
  <p>Any help, suggestions, or thoughts are immensely appreciated.  Thank you.</p>