title: How to get a quality barcode image from string in ios, swift
body: <p>I'm generating an image with barcode using its string like below.</p>
  
  <pre><code>class BarCode {
  
      class func fromString(string : String) -&gt; UIImage? {
  
          let data = string.dataUsingEncoding(NSASCIIStringEncoding)
          let filter = CIFilter(name: "CICode128BarcodeGenerator")
          filter!.setValue(data, forKey: "inputMessage")
          return UIImage(CIImage: filter!.outputImage!)
  
      }
  }
  </code></pre>
  
  <p>so this generates a accurate image. but the quality is low. how can I increase the quality of the image.(I cant increase the size of the image, if I do so it looks liked blured)</p>