I don't want to end the cards, how can i do that ?
I am doing like following but it looks like it repeats one time only after that end ?
Any suggestions ?
-(void)cardSwipedLeft:(UIView )card;
{
//do whatever you want with the card that was swiped
// DraggableView c = (DraggableView *)card;
[loadedCards removeObjectAtIndex:0]; //%%% card was swiped, so it's no longer a "loaded card"
if (cardsLoadedIndex < [allCards count]) { //%%% if we haven't reached the end of all cards, put another into the loaded cards
[loadedCards addObject:[allCards objectAtIndex:cardsLoadedIndex]];
cardsLoadedIndex++;//%%% loaded a card, so have to increment count
[self insertSubview:[loadedCards objectAtIndex:(MAX_BUFFER_SIZE-1)] belowSubview:[loadedCards objectAtIndex:(MAX_BUFFER_SIZE-2)]];
}
I don't want to end the cards, how can i do that ?
I am doing like following but it looks like it repeats one time only after that end ?
Any suggestions ?
-(void)cardSwipedLeft:(UIView )card; { //do whatever you want with the card that was swiped // DraggableView c = (DraggableView *)card;
if (cardsLoadedIndex == [allCards count]) { cardsLoadedIndex = 0; loadedCards = [[NSMutableArray alloc] init]; allCards = [[NSMutableArray alloc] init]; [self loadCards]; } }