title: How to get the smooth scrolling on tableView? (using swift)
body: <p>I am working with tableViews now. Everything works perfect except the smooth scrolling of tableview. Here is a code: </p>
  
  <pre><code>CommonFunctions.loadImageAsyncAndVignette(link, imageView: cell.imageViewMiddleSize, article: arrayMainPage[indexPath.row], viewContr: self)
  </code></pre>
  
  <p>This function loads the image asynchronously and format it using CIFilters.</p>
  
  <pre><code> class func loadImageAsyncAndVignette(stringURL: String, imageView: UIImageView, placeholder: UIImage! = nil, article: ArticleInfo, viewContr: UIViewController) {
  
      imageView.image = placeholder
  
      let url = NSURL(string: stringURL)
      let requestedURL = NSURLRequest(URL: url!)
  
      NSURLConnection.sendAsynchronousRequest(requestedURL, queue: NSOperationQueue.mainQueue()) {
          response, data, error in
  
          if error == nil {
  
              if data != nil {
                  if let image = UIImage(data: data){
  
                      //imageView.image = UIImage(data: data)
  
                      let string = stringURL as String
                      article.updateDictionary(stringURL, image: image)
  
                      let qos = Int(QOS_CLASS_USER_INTERACTIVE.value)
  
                      dispatch_async(dispatch_get_global_queue(qos, 0), { () -&gt; Void in
  
                      let imageEdited = CommonFunctions.vignettePhoto(image, imageViewLocal: imageView)
  
                             dispatch_async(dispatch_get_main_queue(), {
                              imageView.image = imageEdited
                             })
                      })
  
                  }
                  else{
                      println("image is nil")
                  }
              }
          }else{
              let stringError = error.localizedDescription
              CommonFunctions.showAlert("Ошибка", alertText: stringError, alertButtonText: "Закрыть", viewController: viewContr)
          }
      }
  }
  </code></pre>
  
  <p>In the function loadImageAsyncAndVigette, I load the image and format it. Here is formatting function:</p>
  
  <pre><code>class func vignettePhoto(inputImage:UIImage, imageViewLocal: UIImageView)-&gt;UIImage{
  
  
          var beginImage = CIImage(image: inputImage)
          var vignette = CIFilter(name:"CIVignetteEffect")
          vignette.setValue(beginImage, forKey:kCIInputImageKey)
  
          let centerx = (imageViewLocal.frame.width)/2
  
  
          let centery = (imageViewLocal.frame.height)*2
          let center = CIVector(x: centerx, y: centery)
  
          vignette.setValue(center, forKey:"inputCenter")
  
          vignette.setValue( 0.5, forKey:"inputIntensity")
  
          var radius = imageViewLocal.frame.height
          vignette.setValue( radius, forKey:"inputRadius")
  
          let newImage = UIImage(CIImage: vignette.outputImage)
  
      return newImage!
  }
  </code></pre>
  
  <p>I use function loadImageAsync at </p>
  
  <pre><code>override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
   commonFunction.loadImageAsync....
  </code></pre>
  
  <p>}
  Everything works. The result is what I wanted. But I dont have smooth scrolling of table view. On simulator, it is hard to scroll at all. On device it is ok to scroll, but anyway i can see that it is a little bit jumping (not smooth). So, can somebody tell me why the scrolling is not smooth? I used async loading but it doesn't help. </p>