title: how can make a image slideShow in ios using swift its only show one image?
body: <pre><code>import UIKit
  
  class PageViewController: UIViewController {
  
      @IBOutlet weak var myScrView: UIScrollView!
      @IBOutlet weak var pagectr: UIPageControl!
      @IBOutlet weak var imageView: UIImageView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          myScrView.tag = 1
          myScrView.autoresizingMask = UIViewAutoresizing.None
          self.view.addSubview(myScrView)
          self.setupScrollView(myScrView)
  
          pagectr.tag = 12
          pagectr.numberOfPages = 9
          pagectr.autoresizingMask = UIViewAutoresizing.None
          self.view.addSubview(pagectr)
      }
  
      func setupScrollView(scrMain:UIScrollView) -&gt; Void {
          var imgesArray : NSMutableArray = []
          for position in 1...9 {
              var strImage : String = "\(position).jpeg"
              var imges = UIImage(named: strImage)
              imgesArray.addObject(imges!)
  
              imageView.contentMode = UIViewContentMode.ScaleToFill
              imageView.image = imges
              imageView.tag = position+1
              scrMain.addSubview(imageView)
              println(imageView)
          }
  
          scrMain.contentSize = CGSizeMake(scrMain.frame.size.width*10, scrMain.frame.size.height)
          NSTimer.scheduledTimerWithTimeInterval(2, target: self, selector: "scrollingTimer", userInfo:nil, repeats: true)
      }
  
      func scrollingTimer(){
  
          let scrMain: UIScrollView = self.view.viewWithTag(1) as UIScrollView
          let pgctr: UIPageControl = self.view.viewWithTag(12) as UIPageControl
          let contentOffset  = scrMain.contentOffset.x as CGFloat
          var nextPage = (CGFloat)(contentOffset/scrMain.frame.size.width) + 1
          if(nextPage != 9){
              scrMain.scrollRectToVisible(CGRectMake(nextPage*scrMain.frame.size.width, 0, scrMain.frame.size.width, scrMain.frame.size.height), animated: true)
              pgctr.currentPage = Int(nextPage)
          }
          else{
              scrMain.scrollRectToVisible(CGRectMake(0, 0, scrMain.frame.size.width, scrMain.frame.size.height), animated: true)
              pgctr.currentPage = 1
          }
      }
  }
  </code></pre>
  
  <p>I want to make a image slide show app using swift in ios please help me it's show only one image.I get a blank screen, almost as if the animations aren't keeping up, and then when I wait a moment and swipe again the image views speed up into place and works normally again. Any idea what I'm doing wrong? What is the best practice when it comes to implementing an image carousel like this with a dynamic amount of images (here they're hardcoded)?</p>