Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I to make 3 cards? #5

Closed
frank0ch0a opened this issue May 15, 2014 · 6 comments
Closed

How do I to make 3 cards? #5

frank0ch0a opened this issue May 15, 2014 · 6 comments
Labels

Comments

@frank0ch0a
Copy link

Hi thanks for sharing , how do I to make 3 cards like tinder, ? I tried but did not worked

Thanks

@modocache
Copy link
Owner

Three cards is not much different than the two-card example app in Examples/LikedOrNope. What have you tried? What exactly did not work?

@frank0ch0a
Copy link
Author

I configured frontCardView,MiddleCardView and backCardView, then configured middleCard like example likeornope backcard, and the last one frame of backcard use frame parameters of middlecard, when I run the app , it show me three cards, but when I swipe to choose , only show me one card and do not show me three again , thanks

@modocache
Copy link
Owner

In the sample app, when a swipe is completed, the "back card" is moved to the front:

self.frontCardView = self.backCardView;

Then, a new back card is created:

self.backCardView = [self popPersonViewWithFrame:[self backCardViewFrame]];

If you want three cards, you just need to do the same with three cards. Let's say they're called self.frontCardView, self.middleCardView, and self.backCardView:

// Move the middle and back cards to the front and middle
self.frontCardView = self.middleCardView;
self.middleCardView = self.backCardView;

// Create a new back card
self.backCardView = [self popPersonViewWithFrame:[self backCardViewFrame]];

There might be a better way to do this, perhaps by using UICollectionView, but if you want to imitate the example app, I think this is the simplest approach.

Hope that helps!

@frank0ch0a
Copy link
Author

I made your approach and it works,but using pop method to create middleCardView and backcardView, and I will have to adjust the y origin in middle card afterwards to finished the swipe.thanks again!

@modocache
Copy link
Owner

My pleasure! Good luck with your app!

@dorinsimina
Copy link

@frank0ch0a can you give me more details on how you implemented 3 cards. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants