r/iOSProgramming • u/dadofbimbim Swift • Jan 07 '21
Solved! Took me 2 days to implement the capture button almost the same with stock iOS camera. Along with its animation. I’m so proud of myself!
4
u/NotlivingNordead Jan 07 '21
I tried clicking the button on the photo to see what would happen. Maybe I am retarded?
1
u/dadofbimbim Swift Jan 07 '21
Haha here’s the animation https://twitter.com/dirtylowprofile/status/1347272960231395328?s=21
2
u/juanjovn Jan 07 '21
But I mentioned time constraint because this is for a client and I am working hourly.
you are not alone haha
3
u/larsonthekidrs Swift Jan 07 '21
Is there a GitHub link where I can check out how you achieved this?
2
u/dadofbimbim Swift Jan 07 '21
I’ll write about this in a couple of days.
1
u/larsonthekidrs Swift Jan 07 '21
Thank you!
2
u/dadofbimbim Swift Jan 08 '21
Hi! Here’s a quick write up. Let me know if you tried it already.
https://lwgmnz.me/2021/01/08/create-a-camera-shutter-in-swift/
1
4
u/mRs- Jan 07 '21
How many hours did you spent in Interfaxe builder for this?
6
u/dadofbimbim Swift Jan 07 '21
Hmm an hour or two. The animation was the thing that made it complicated
2
u/juanjovn Jan 07 '21
How does the animation look at the end? Can you post a gif or something?
2
u/dadofbimbim Swift Jan 07 '21
I don’t know how to upload gif here so I tweeted it.
https://twitter.com/dirtylowprofile/status/1347272960231395328?s=21
1
1
u/dadofbimbim Swift Jan 07 '21
Here’s the animation: https://twitter.com/dirtylowprofile/status/1347272960231395328
It’s not entirely same as stock camera but at least I got the circle to square transition. I’ll write a post about it in a couple of days.
1
u/bcgroom Jan 07 '21
I have done the exact same thing at work. Did you do it because you didn’t want the confirmation screen that comes after this when you use UIImagePickerController?
1
u/dadofbimbim Swift Jan 08 '21
It’s because our app has a different logic and design from any default camera that records video.
1
u/aheze Swift Jan 08 '21
Nice work! I made something very similar recently too. I like your animation better though.
2
u/dadofbimbim Swift Jan 08 '21
Dope! I think we have the same animation but only differs in duration.
1
0
Jan 07 '21
[deleted]
8
u/dadofbimbim Swift Jan 07 '21
Thanks! Yes I learned a lot and this is why I love programming and mobile development in general. But I mentioned time constraint because this is for a client and I am working hourly.
4
0
Jan 07 '21
[deleted]
2
2
u/dadofbimbim Swift Jan 08 '21
Hi! Here’s the quick write up on how I developed it. Let me know if you have any questions.
https://lwgmnz.me/2021/01/08/create-a-camera-shutter-in-swift/
10
u/danen_ Jan 07 '21
Do you work with some custom UIView or with UIButton with layers? Nice work btw