DroidsOnRoids / SwiftCarousel

Lightweight, written natively in Swift, circular UIScrollView.
http://www.thedroidsonroids.com/blog/ios/circular-scroll-view-swiftcarousel/
MIT License
144 stars 43 forks source link

Carousel's index reset when I'm swiping carousel #39

Open aluco100 opened 8 years ago

aluco100 commented 8 years ago

This is my Code :

    self.carousel = SwiftCarousel(frame: CGRect(origin: CGPointZero, size: CGSize(width: 574, height: 455)))

    try! self.carousel!.itemsFactory(itemsCount: self.eventsStorage.count, factory: {
        choice in
        let baseUrl = "http://www.eventyk.com/events-media/"
        let url = NSURL(string: "\(baseUrl)\(self.eventsStorage[choice].imageNamed)")
        let data = NSData(contentsOfURL: url!)
        let imageView = UIImageView(image: UIImage(data: data!))
        imageView.frame = CGRect(x: 0.0, y: 0.0, width: 574, height: 455)
        print(imageView)
        return imageView
    })

    self.carousel!.resizeType = .VisibleItemsPerPage(1)
    self.carousel!.delegate = self
    self.carousel!.defaultSelectedIndex = 1
    self.carouselView.addSubview(carousel!)

What's wrong?

sunshinejr commented 8 years ago

Hey @aluco100! 🎉 Can't really tell from the code above... Would you be so kind to put it somewhere on github, on the clean project where you can reproduce the bug? It would be a lot easier to investigate the issue and help you resolve it. Thanks! 🐼

aluco100 commented 8 years ago

Hey @sunshinejr there's my project:

https://github.com/aluco100/Eventyk

Regards

kodeark commented 8 years ago

Hey @sunshinejr, Is the above issue fixed. I noticed the same problem.