title: How to draw text in PDF context in Swift?
body: <p>I have a simple function that create pdf file and return its path.</p>
  
  <pre><code>func createPDFFileAndReturnPath() -&gt; String {
  
      let fileName = "pdffilename.pdf"
      let paths = NSSearchPathForDirectoriesInDomains(.LibraryDirectory, .UserDomainMask, true)
      let documentsDirectory = paths[0]
      let pathForPDF = documentsDirectory.stringByAppendingString("/" + fileName)
  
      UIGraphicsBeginPDFContextToFile(pathForPDF, CGRectZero, nil)
  
      UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, 100, 400), nil)
  
      let text = "text" //how to print this in whatever place?
  
      //text.drawInRect - this doesn't work
  
      UIGraphicsEndPDFContext()
  
      return pathForPDF
  }
  </code></pre>