title: Using Do/Catch in Swift
body: <p>I am working on an app and want to get data back from a function. However sometimes data is missing or is different from the kind of that I want to retrieve. I am new to Swift and I can't find a way to write a function that does a little bit of processing and returns this data. When this data is missing, the function should give back a string "Not Found". Like this:</p>
  
  <pre><code>func processData(data:String) {
      do {
          //processing
          var result = processedData
      } catch {
          var result = "Not Found"
      }
  
      return result
  }
  </code></pre>
  
  <p>It would be very nice if somebody could help me.</p>