         }
     }
     
+    /// Initializer
+    ///
+    /// - Parameters:
+    ///   - model: Model for carousel
+    ///   - initialPage: Page to display when carousel first shown
+    /// - Throws: emptyModel, pageOutOfRange
     init(with model: [KSImageCarouselDisplayable], initialPage: Int) throws {
         
         // Make sure model is not empty


import Foundation

protocol KSICCoordinator: class {
    var carousel: KSICImageScrollerViewController? { get }
    var model: [KSImageCarouselDisplayable] { get }
    var carouselViewModel: [KSImageCarouselDisplayable?] { get }
    var currentPage: Int { get }
    
    func showCarousel()
    func nextPage()
    func previousPage()
}


        }
    }
    
    // MARK: KSICCoordinator conformation
    public func showCarousel() {
        //        let vm = viewModel(forPage: currentPage)
        _carousel = KSICImageScrollerViewController()
        //        carousel.delegate = self
    }
    
    func nextPage() {
        if currentPage == lastPage {
            try! goto(page: firstPage)
        } else {
            let newPage = currentPage + 1
            try! goto(page: newPage)
        }
    }
    
    func previousPage() {
        if currentPage == firstPage {
            try! goto(page: lastPage)
        } else {
            let newPage = currentPage - 1
            try! goto(page: newPage)
        }
    }
    
    // MARK: Private functions
    
    /// Go to a specific page
    ///
    /// - Parameter p: page number
    /// - Throws: pageOutOfRange
    private func goto(page p: Int) throws {
        
        // Make sure page is between first page and last page
