r/iOSProgramming • • Apr 04 '18

Recreating the Tinder UI with 20 lines of code

https://medium.com/@raulriera/uikit-dynamics-in-the-real-world-ef0dfd924260
33 Upvotes

20 comments sorted by

52

u/[deleted] Apr 04 '18

The end result is neither the full Tinder UI or 20 lines of code. I’m confused.

37

u/RECURSIVE_META_JOKE Objective-C / Swift Apr 04 '18

Recreating clickbait with one line of text

-18

u/raulriera Apr 04 '18

Should have mentioned Tinder UX, but yeah you got a point. It’s less than 20 lines 🙂

5

u/well___duh Apr 05 '18

UI != UX

-10

u/raulriera Apr 05 '18

That’s why I said that

5

u/Rudy69 Apr 05 '18

So the title is just a lie? Why not use a better one like "Recreating the Tinder cards using UIDynamics"?

5

u/KarlJay001 Apr 05 '18

Thanks for the post!

Builder, iOS Software Engineer. I fought in the great Storyboards vs Code War. More at http://raulriera.com

Can you tell us about the Storyboards vs Code war? Quite a few here like to use code, where do you stand and why? Did you do any write ups on it?

Here's a link to the code, the link in Medium doesn't have the download button. https://github.com/raulriera/technical-articles

2

u/raulriera Apr 05 '18

Hey Karl, it's mostly a joke hehe... just the thing developers love to argue the most... Interface Builder vs Code, Swift vs Objective-C, Cocoapods vs Carthage... etc 🙂

2

u/sonnytron Apr 06 '18

It was a long fought battle.
In the end, no one won... But everyone lost.

1

u/KarlJay001 Apr 06 '18

I think you're right, whoever likes to code will code, those that like IB will continue to use it. Not much gained from arguing about it.

I'm just glad we have the option to code.

1

u/sonnytron Apr 06 '18

And honestly Apple does improve the coding aspect of layouts all the time.
We got the ability to activate NSLayoutConstraints and access the layout guides through code.
There's a lot of really cool stuff you can do to improve layouts since the old days.

1

u/KarlJay001 Apr 06 '18

The best way to think of it is that everything can be done in code. IB is just grabbing the code and running it interactively.

I guess everyone already knows that all the IB stuff is stored in XML code.

14

u/staires Swift Apr 05 '18

I think people are being unfair. Based on the title I immediately assumed all you meant by "Tinder UI" was the iconic card-swiping gesture and physics.

3

u/iamdimpho Apr 05 '18

could have been worded better, but yeah same.. :/

11

u/dancemonkey Apr 04 '18

Had never even heard of UIDynamics, thank you for the excellent article.

5

u/perolan Apr 04 '18

The article showed me some new stuff but.. that's not Tinder at all lol

2

u/criosist Objective-C / Swift Apr 05 '18

Good introduction to simple UIDynamics and if it stops 1 guy pulling in a tinder cards library +1

1

u/chedabob Apr 05 '18

UIKitDynamics is a nice way of doing it, but a little overkill. You can get fairly similar behaviour with standard UIView animations + springWithDamping, or UIViewPropertyAnimator.

1

u/powerje Apr 05 '18

It's kind of difficult to use the APIs you mention and get interactive animations isn't it?

1

u/chedabob Apr 06 '18

With UIViewPropertyAnimator you can by setting fractionComplete and reversed.