Swift Animations: Facebook Shimmer using Gradient Masks

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024
  • Animations are awesome to build and even more fun to play around with when you get it working correctly. In today's lesson we'll dive into how we can use a CAGradientLayer as a mask to achieve a Facebook Shimmer style animation. Enjoy
    Podcasts Course
    www.letsbuildt...
    Intermediate Training Core Data
    www.letsbuildt...
    Instagram Firebase Course
    www.letsbuildt...
    Facebook Group
    / 1240636442694543
    Completed Source Code
    www.letsbuildt...
    Instagram: / buildthatapp
    Twitter: / buildthatapp

ความคิดเห็น • 142

  • @asadjamil7503
    @asadjamil7503 6 ปีที่แล้ว +7

    You have any plans to update Instagram Firebase to latest swift 5?

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว +4

      Hey Asad, the projects and source code have been updated to Swift 5 for the Instagram Firebase course. Go ahead and download it on the website at www.letsbuildthatapp.com/course/Instagram-Firebase

    • @asadjamil7503
      @asadjamil7503 6 ปีที่แล้ว +1

      Lets Build That App that’s great!

    • @shawnmiller4057
      @shawnmiller4057 6 ปีที่แล้ว +1

      you plan on adding any additional lessons to instagram firebase?

    • @heyrahulrs
      @heyrahulrs 6 ปีที่แล้ว +8

      But Swift 5 isn’t released yet🤔🤔

    • @asadjamil7503
      @asadjamil7503 6 ปีที่แล้ว

      Rahul 4.2 is released! Apple will be releasing or not?

  • @riklowe
    @riklowe 6 ปีที่แล้ว +8

    Hey Brian - you accidentally removed the add subview of the darkTextLabel at the beginning of the video - right at the time you were saying that copy and paste was dangerous !!! Excellent example of why cut and paste is dangerous - lol
    Thanks for another great video

  • @Archetapp
    @Archetapp 6 ปีที่แล้ว +8

    Nice one Brian! Was looking into this just the other day & this helps clarify things quite a bit for me. 👌

    • @krisdundurs6672
      @krisdundurs6672 6 ปีที่แล้ว +3

      Jared Davidson while Brian is amazing with teaching a bit more advanced stuff, I gotta give you a huge thanks as well, Jared. I literally went from zero to getting my foot in the door just from your Swift 2.0 videos back in the day. Been a professional full-time developer for a year now. 🔥 Love the TH-cam iOS community. Thanks, all of you!

    • @Archetapp
      @Archetapp 6 ปีที่แล้ว +4

      Kris Dundurs Thanks Kris! That means a lot. I knew going into this whole TH-cam thing that I wasn’t the best programmer by any means, I was there to share what I know and improve as I go along. Glad I could help you get that foot in the door! That’s the hope I have for all of my tutorials, to at least get people interested and started. :]

    • @malithmnk93
      @malithmnk93 6 ปีที่แล้ว +1

      Jared Davidson, nice to see you here...❤️

    • @mdhasanshaikh6403
      @mdhasanshaikh6403 4 ปีที่แล้ว

      Jared Davidson
      Thank you so much for helping us. To learn iOS in such simplified way..💛

  • @alcprado
    @alcprado 5 ปีที่แล้ว +3

    Man, I wish I had your skills!

  • @seccat
    @seccat 6 ปีที่แล้ว

    I like the personal challenge at the end, to apply what you have just demonstrated.
    I tried to complete the “Kickass Animated Progress Circle”, with multiple views and spinning numbers.... and it was rough.
    Thx again. Hope to see you apply this to Flutter, some day.

  • @johniiibibal8838
    @johniiibibal8838 5 ปีที่แล้ว

    Holy Sh*t, I've been looking for a guide for this for a long time. I'm glad that I found it on your channel. Love the way you teach. Cheers!

  • @meerasayabu3823
    @meerasayabu3823 6 ปีที่แล้ว

    It's really awesome. Thanks Brian.

  • @andreiamza184
    @andreiamza184 6 ปีที่แล้ว

    Dudeeee you are sooo .... mind blowing... today i had that feeling when i saw the same animation in the youtube app on ios.. how i could i implement that in an IOS app and you did this animation. Great man! Keep up working because you are the best on this platform when it comes about IOS Development.

  • @edysudarto8825
    @edysudarto8825 6 ปีที่แล้ว +2

    Damn!! This is awesome. Thanks a lot, what a great thing to learn, it's amazing!!

  • @tanhuynh432
    @tanhuynh432 4 ปีที่แล้ว

    Amazing bro!

  • @alcprado
    @alcprado 5 ปีที่แล้ว

    "you can set to whatever color your heart desires" was pretty nice hehee

  • @tylerrutt17
    @tylerrutt17 6 ปีที่แล้ว

    Exactly what I've been looking for recently! Thanks!

  • @alialnaghmoush
    @alialnaghmoush 6 ปีที่แล้ว

    Brian You are awesome, Thank you for the wonderful lessons
    I am following your lessons and courses and Your lessons have developed me more
    Thanks Brian and we look for more lessons and courses

  • @mike_thecatlover
    @mike_thecatlover 5 ปีที่แล้ว

    Brian everything you explained so clear and simple. Why some original documents make it not easy for human beings to understand?

  • @ak9tgaming714
    @ak9tgaming714 5 ปีที่แล้ว

    If someone's wondering why the "darkTextLabel" isn't showing in the shimmer animation , it's because brian forgot to add view.addSubview(darkTextLabel).
    Awesome tutorial though! Thank You Brian :-)

  • @andreagualandris2462
    @andreagualandris2462 3 ปีที่แล้ว

    beautiful tutorial , thank you

  • @swifty7503
    @swifty7503 6 ปีที่แล้ว

    Brian you are my hero! Thank you for this video.

  • @djryanashton
    @djryanashton 8 หลายเดือนก่อน

    Great! Thanks :)

  • @albaqawi
    @albaqawi 6 ปีที่แล้ว

    Awesome so clear and simple

  • @ahmdmhasn
    @ahmdmhasn 4 ปีที่แล้ว

    Thanks Brian.. Perfect as usual!

  • @AgamRandhawa
    @AgamRandhawa 6 ปีที่แล้ว

    just on time Brian.u rock man

  • @TheJhuerta88
    @TheJhuerta88 6 ปีที่แล้ว

    You make it look so easy. 👍🏼👍🏼

  • @ehawkins730
    @ehawkins730 6 ปีที่แล้ว

    GREAT!!!!!!! thanks Brian!

  • @Hackmajoris
    @Hackmajoris 6 ปีที่แล้ว +3

    Hey Brian. Thank you for your work. You know, I have an idea for a new tutorial. You already did it in the past for this app. It is for the new App Store design. There is some elements like these cards - with a nice animation when you press on them. I did try to implement such animation but without any success.

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      I believe its just a simple frame transform.

    • @AlfredoElizondoLife
      @AlfredoElizondoLife 6 ปีที่แล้ว +1

      You can find that animation on the you tube course on this channel, when he's is making the video player

    • @mrvfino
      @mrvfino 6 ปีที่แล้ว

      Hi! I made sample project for that a few weeks ago. :D
      github.com/markrufino/PopUpCards

  • @sunsunai13
    @sunsunai13 6 ปีที่แล้ว

    Nice one Brian

  • @sasniyFriz
    @sasniyFriz 4 ปีที่แล้ว

    This helped me a lot. Thanks, Brian :)

  • @Vankien96
    @Vankien96 6 ปีที่แล้ว

    Thanks so much.
    With gradient layer if you want to add .clear color, you should use UIColor(white: 1, alpha: 0). because clearColor has a black color channel with an alpha of 0. so it will show black instead of .clear Color.

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      Not exactly sure about this one. The clearColor seemed pretty clear when I used it. Perhaps the black alpha channel is something I'm not seeing correctly.

  • @Joyceview
    @Joyceview 6 ปีที่แล้ว

    Awesome!!

  • @cinquain0
    @cinquain0 5 ปีที่แล้ว

    That video was fire! You need to put up a patreon Brian

  • @MrJoeYellow
    @MrJoeYellow 6 ปีที่แล้ว

    Great tutorial👍

  • @ssdev1652
    @ssdev1652 6 ปีที่แล้ว

    hey man. it's so good that you're back with yt tutorials. Maybe you can make a course (it can be paid for) focused more on 'production' code aspects (protocol-oriented programming, objects with functions, more advanced enums)?

  • @tazihosniomar
    @tazihosniomar 6 ปีที่แล้ว

    thank you sensei you're the best !

  • @tonyd6853
    @tonyd6853 6 ปีที่แล้ว

    Wow this is great! Video chat integration next! lol.

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      I haven't figured out what is a good video chat feature yet. I'm not part of the snapchat generation.

  • @nizz4m
    @nizz4m 5 ปีที่แล้ว

    Hope you gonna release the challenge answer. Thank you.

  • @abhijithadkar9451
    @abhijithadkar9451 6 ปีที่แล้ว

    Thankss for thiss....great

  • @cinquain0
    @cinquain0 5 ปีที่แล้ว

    More fire!

  • @tanhungnguyen1980
    @tanhungnguyen1980 6 ปีที่แล้ว

    thank you

  • @kav04
    @kav04 6 ปีที่แล้ว +18

    You didn't add - view.addSubview(darkTextlabel) So darkTextlabel doen't work

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว +2

      Ah, thats why I wasn't seeing it! The demo definitely has it though :)

    • @heyrahulrs
      @heyrahulrs 6 ปีที่แล้ว

      I was also wondering the same

    • @rebellious_703
      @rebellious_703 6 ปีที่แล้ว +2

      I waited till end that Brian will fix it but he forgot. Though its awesome video , thanks

  • @amitkumardas5650
    @amitkumardas5650 6 ปีที่แล้ว

    Hey Brian, please show how to implement ARC in your Instagram Firebase course. IMHO every developer should know do's and dont's w.r.t retain cycles.

  • @nuno591
    @nuno591 5 ปีที่แล้ว

    Nice work Brian! For obvious reasons, loading screens are used very commonly while apps are receiving data from the server. How would you do this shimmer if the size of the views were dependent on the data received?

  • @doffydonqouite7519
    @doffydonqouite7519 6 ปีที่แล้ว

    Good day brian !

  • @ronaldojr3948
    @ronaldojr3948 5 ปีที่แล้ว +1

    This reminds me "Slide to unlock"

  • @kevstuckbykevdotcom2743
    @kevstuckbykevdotcom2743 5 ปีที่แล้ว

    Hi Brian. I love watching your videos. I like how you explain details well. I'm having a problem with this one for some reason. Im trying to apply this to a few UIButtons and its making the buttons not visible at all and no animation. Any thoughts?

  • @mcnimi
    @mcnimi 6 ปีที่แล้ว

    i think you can get diagonal gradient directly from the layer like so:
    gradientLayer.startPoint = CGPoint.init(x: 0, y: 0)
    gradientLayer.endPoint = CGPoint.init(x: 1, y: 1)

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว +1

      Ah yes indeed. My demo uses a -60 degree tilt so that led me to perform the transform instead.

  • @amitkumarghodke5998
    @amitkumarghodke5998 6 ปีที่แล้ว

    nice learned something new.
    any plan for multi language app? change language within app?

  • @swetajaiswal4222
    @swetajaiswal4222 5 ปีที่แล้ว

    Hello, could you please upload a tutorial to test Url response using mocking in swift?

  • @SHASHWAT128
    @SHASHWAT128 5 ปีที่แล้ว

    Hey Brian, I tried to repeat the same animation as per your tutorials but I did it as a presented view controller and it didn't work. After struggling for a while I went to your website to download code and same issues happened, then instead of presenting the VC, I pushed it in a navigation controller and magically it started working. Is there any differences in CALayer animations when I present or push. Can you please help. I am kind of confused why is it giving such different behaviours in these two situations. It would be great if you could throw some light onto this! Thanks. Btw you make great stuff. I am an iOS Developer with 1 year experience and I find your tutorials quite practical. Kudos man! 😎🤘🏻

  • @aaravsingh2492
    @aaravsingh2492 5 ปีที่แล้ว

    Hi Brian, nice tutorial as always.. :) one thing I noticed about the animation is that when we touch or swipe or do any gestures on the label the animation lags. Do you also get that?

  • @iFranKim
    @iFranKim 6 ปีที่แล้ว

    Hey Brian! Awesome tutorial, I was wondering how this was done. Just one quick question, how do I stop and delete the animation? Since this is supposed to replace a UIActivityIndicatorView. I've tried removing the images from it's superview, making it's isHidden property true, but to no avail. I can stop the animation itself with layer.removeAllAnimations() but no matter what i do, the image does not go away.
    Thank you in advance

  • @kevinjefferson9849
    @kevinjefferson9849 5 ปีที่แล้ว

    Hello Brian for the shimmer color or is it possible to have 3 or 4 different color layers go over the shimmer label ? And if so how

  • @YogeshPateliOS
    @YogeshPateliOS 6 ปีที่แล้ว +1

    Hello Sir can I upload this video in hindi with your permission ?? I’m also youtuber like you but I’m teaching ios in hindi so please reply sir this video is too good Sir :) thank you

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว +2

      Yeah, you should teach the subject with your own style though. The pattern I follow is very unique to the way my brain works, so structure it according to your own cadence.

  • @romualdbrochard8674
    @romualdbrochard8674 5 ปีที่แล้ว

    `gradientLayer.frame` shouldn't be equal to `shinnyTextLabel.bounds` instead of `shinnyTextLabel.frame`? This works here because the label is pinned on top left of the screen so frame and bounds are equivalent, but if you had a padding on the Label, it would also translate its layer inside

  • @stevengao8345
    @stevengao8345 6 ปีที่แล้ว

    nice tutorial, by any chance would you teach us how to do the animation inside facebook the user tap and hold like button, and a line of faces pop out ? no rush been follow you for almost 1.5 years now, just something to put in your mind. : ) thanks

  • @foodcouplelb
    @foodcouplelb 6 ปีที่แล้ว

    Hello Brian, can you make a video on infinite scroll/ pagination? Thank you

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      Hello Husam, there are some lessons on pagination available here: www.letsbuildthatapp.com/course_video?id=1612

  • @charlesm.1638
    @charlesm.1638 6 ปีที่แล้ว

    WOW!!, Can this be added to the launch screen?

    • @SSA-X002
      @SSA-X002 6 ปีที่แล้ว

      not possible, however you can create a false launch screen copying you launch screen into a new viewcontroller's view, users won't notice the transition.

  • @gorilka_
    @gorilka_ 6 ปีที่แล้ว

    Hey Brian! Why did not you use startPoint and endPoint properties for CAGradientLayer to make it diagonal?

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      For my finished app, I had a 60 degree shimmer. Using start and end point is pretty difficult for performing the correct rotation.

  • @ZoepX
    @ZoepX 6 ปีที่แล้ว

    Quick question: For the Facebook demo on the right side. Did you use a placeholder cell/view that applies the animation or is it the actual cell/view you use for displaying data with the animation on top of its views? I did it with a place holder cell that reflects loading and then swapped it with actual cell I used once the data has been downloaded from web.

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว +1

      You can download the source code for the FB demo with the link in the description. I hacked together two images and put the shimmer animation on top.

    • @ZoepX
      @ZoepX 6 ปีที่แล้ว

      Thanks!

  • @thorlarson6150
    @thorlarson6150 6 ปีที่แล้ว

    Just switched to not using storyboards because of your channel and I’m not going back it’s so much easier without them. I’m wondering if you have any plans on doing a slide in menu implementation without storyboards similar to the menu in the TH-cam App tutorials except the menu pushes the screen and is not just overlaid on top. Thanks

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      Cool, did you check out the "lets build youtube" series already?

    • @thorlarson6150
      @thorlarson6150 6 ปีที่แล้ว

      Lets Build That App Yep I watched all of them, but in those videos the menu view shows on top of the current view controller. Is there a way to also change the position of the main screen like the menu is pushing the main screen out of the way? (similar to the popular SWRevealViewController)

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      Yeah there are many ways to build out this type of feature. All of which require a video or a long post :)

  • @RehanAli-es5nh
    @RehanAli-es5nh 6 ปีที่แล้ว

    Hi Brain! I tried this animation but my animation didn't work in viewDidLoad. I've to place in viewdidAppear.
    Second i tried facebook shimmer animation with simple view. When i placed in tableview it didn't work but on simple view animation works.
    Any thoughts on this.

  • @watchit387
    @watchit387 3 ปีที่แล้ว

    why the behind label is not visible

  •  4 ปีที่แล้ว

    How do you do this in SwiftUI?

  • @josetony9181
    @josetony9181 6 ปีที่แล้ว

    Pretty good tutorial!!!
    I'm an Android developer but I want to switch to iOS, what advices can you give sr.?

  • @Theasstasticvillain
    @Theasstasticvillain 6 ปีที่แล้ว

    Is there a way to blend the gradient more?

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      Yeah, you can always play with the location numbers of your gradient or provide more colors.

  • @kev8660
    @kev8660 6 ปีที่แล้ว

    Hey just a question apart of the content of the video, wich video recorder do you use?

  • @MrTalhakhan01
    @MrTalhakhan01 6 ปีที่แล้ว

    I don't know why but I don't feel comfortable with providing depending variables as string (like in keypath : "transform.translation.x")..
    Great tutorial anyways!

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว +1

      I don't think there's any way around this one yet.

  • @---ml4jd
    @---ml4jd 6 ปีที่แล้ว

    hello brain.
    i want to ask you a question please.
    i want to add some random pictures from the internet in an app.
    will there be a problem? since i don't own these pictures?
    what exactly is going on regarding this subject.
    thank you very much.

  • @foooo294
    @foooo294 6 ปีที่แล้ว

    Do you have courses for complete beginners ?

    • @ehawkins730
      @ehawkins730 6 ปีที่แล้ว

      Yes he does...check out the site. There are free courses on there for beginners. Helped me tremendously!. Good luck!!

    • @foooo294
      @foooo294 6 ปีที่แล้ว

      thanks mate

  • @NiteshKumar-bk1wd
    @NiteshKumar-bk1wd 5 ปีที่แล้ว

    Its work for tableview Xib ??

  • @malcolmcollinable
    @malcolmcollinable 6 ปีที่แล้ว

    Siri triggered at 7:59 lol

  • @moalimus
    @moalimus 6 ปีที่แล้ว

    UPDATE: (I have completed the purchase but after many tries). Thanks man. Paypal button is not working on the website. I wanted to buy a course but it's not responding.

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      I see, were you trying to purchase on mobile?

    • @moalimus
      @moalimus 6 ปีที่แล้ว

      No, desktop.

  • @gokhandemirer
    @gokhandemirer 6 ปีที่แล้ว

    Hi Brian, I want to ask a question that is not relevant to the subject. How does autocomplete work when we write the name of the argument?

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      I just type out the argument names and hope for the best with autocomplete.

    • @gokhandemirer
      @gokhandemirer 6 ปีที่แล้ว

      I understand, but it doesn't work when I use. Thanks

  • @rlamichhane
    @rlamichhane 6 ปีที่แล้ว

    🙂🙂

  • @chimansong8653
    @chimansong8653 4 ปีที่แล้ว

    I luv u

  • @MrQouTube
    @MrQouTube 6 ปีที่แล้ว

    Is it allowed to use this effect in my own app without marking Facebook as the copyright owner? Or is it just neccessary if you use their library (github.com/facebook/Shimmer)

  • @dilsmatchanov
    @dilsmatchanov 6 ปีที่แล้ว

    Are you gonna update XCode?

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      I have the latest release version of xcode. My laptop is running beta.

    • @dilsmatchanov
      @dilsmatchanov 6 ปีที่แล้ว

      Oh XD. Just I noticed that you have a lot of blank lines at the bottom of your editor.

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว

      Yeah, it'll be great to be able to just scroll down with the new xcode.

  • @samirdesigner3324
    @samirdesigner3324 6 ปีที่แล้ว

    thanks
    if make keyboard is good
    thanks again

  • @sachinarora7994
    @sachinarora7994 6 ปีที่แล้ว

    Hey Brian...can I get your Instagram fire base tutorials for free or with some discounts.

    • @LetsBuildThatApp
      @LetsBuildThatApp  6 ปีที่แล้ว +1

      Hello sachin, the Instagram Firebase course is already at a heavy discount. I'm sure you'll get more than you moneys worth out of all the videos that are available there. Thanks for supporting me and this channel.

  • @nizz4m
    @nizz4m 6 ปีที่แล้ว

    You need a haircut sir 😁