modocache / MDCSwipeToChoose

Swipe to "like" or "dislike" any view, just like Tinder.app. Build a flashcard app, a photo viewer, and more, in minutes, not hours!
MIT License
2.55k stars 421 forks source link

proper way to load more #93

Open fresh83 opened 9 years ago

fresh83 commented 9 years ago

having a hell of a time getting it to load more without causing the last card to be skipped or crashing to occur due to something or another.

•What method should loadmore be called in •What should be called after more data has been loaded.

acegreen commented 9 years ago

I did it in the wasChosenWithDirection function

    if self.charts.count <= 5 {

        // GetObjects and make charts
        getObjectsAndMakeCharts()

    }
acegreen commented 9 years ago

Also my load function doesn't just the last card, it knows the position of the card being loaded (i.e. 0, 1 or 2) and loads the correct array element.