             }
         }
 
-        pageControl.numberOfPages = views.count
+        if infiniteLoop {
+            pageControl.numberOfPages = views.count - 2
+            let x = frame.size.width * 1
+            let origin = CGPoint(x: x, y: 0)
+            scrollView.contentOffset = origin
+        } else {
+            pageControl.numberOfPages = views.count
+        }
     }
 
     private func clearSubviewsInScrollView() {

extension TDPagedImageScrollView: UIScrollViewDelegate {
    public func scrollViewDidScroll(scrollView: UIScrollView) {
        let pageWidth = scrollView.frame.size.width
        let xOffsetRelativeToPageWidth = scrollView.contentOffset.x/pageWidth

        // Update when scrolling to more than 50% of the previous/next page
        pageControl.currentPage = Int(floor(xOffsetRelativeToPageWidth + 0.5))
    }
}

extension TDPagedImageScrollView {
    internal func configureWithColoredViews() {
        let colors: [UIColor] = [
            .blackColor(),
            .whiteColor(),
            .blackColor(),
            .grayColor(),
            .blackColor(),
        ]

        let views = map(colors) { color -> UIView in
            let view = UIView()
            view.backgroundColor = color
            return view
        }

        configureWithViews(views)

import SnapKit
import WebImage

private let URLToImageView: NSURL -> UIImageView = { URL -> UIImageView in
    let view = UIImageView()
    view.sd_setImageWithURL(URL)
    return view
}

extension TDPagedImageScrollView {
    public func configureWithImages(images: [UIImage], infiniteLoop: Bool = false) {
        self.infiniteLoop = infiniteLoop

        var views = images.map { return UIImageView(image: $0) }

        configureWithViews(views)
    }

    public func configureWithImageURLs(imageURLs: [NSURL], infiniteLoop: Bool = false) {
        self.infiniteLoop = infiniteLoop

        var views = imageURLs.map(URLToImageView)

        configureWithViews(views)
    }

    internal func configureWithViews(var views: [UIView]) {
        clearSubviewsInScrollView()

        let superView = containerView
