Swift Tutorial - UIViewPropertyAnimator - Control Your Animations

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

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

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

    Watch Next - iOS Take Home Project - Job Interview Practice - Free Preview - th-cam.com/video/MSIe2y6Fee8/w-d-xo.html

  • @thompheijffer6379
    @thompheijffer6379 5 ปีที่แล้ว +11

    Good to see you back with a tutorial!

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

      Thanks Thon 😀

  • @felipenka
    @felipenka 5 ปีที่แล้ว +10

    When i see your videos i think "Angela Yu or Paul Hudson are the teacher i would want to have, but Sean it's the coworker any developer(jr or senior) want or must have in any working team"... Good content!

    • @seanallen
      @seanallen  5 ปีที่แล้ว +2

      Thanks for those kind words, Felipe! I like to think I'm a good teammate 😀

  • @TygruletZ
    @TygruletZ 5 ปีที่แล้ว +2

    The best free Swift content what you can find it on YT ! I love you man !

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

      Thanks for the kind words 😀

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

    This is awesome! I had no idea this was possible and have been struggling trying to get UIView.Animate to do an animation very similar to the one you used here as your demo!

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

      Nice! Sounds like the video was very helpful then 😀

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

    This is pretty cool stuff, Sean! Thanks for sharing. 👍

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

      No problem Mark!

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

    Thank you so very much, Sean for your hard work and effort. Your channel is is amazing source of knowledge when it comes to Swift or iOS development in general for newbies like myself. I also enjoy your informative podcasts while driving. Thank you for bringing so much for the community!

  • @vamsi3877
    @vamsi3877 5 ปีที่แล้ว +4

    Nice video 👏👏 I am expecting more animations tutorials

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

      Anything specific?

  • @onlydubz558
    @onlydubz558 5 ปีที่แล้ว +2

    Very cool. To the point and no BS.

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

      Glad you enjoy my teaching style 😀

  • @SandeepSingh-lg7bq
    @SandeepSingh-lg7bq 5 ปีที่แล้ว +1

    Thanks Sean for this sweet sweet animation video.

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

      Glad you liked it!

  • @DW-cg8vy
    @DW-cg8vy 5 ปีที่แล้ว +1

    Sean you really are the best man I admire your hard work and dedication and thank you for sharing so much of your story, you are inspiring, This video is awesome I knew eventually you would get to UIViewPropertyAnimator thank you Sean!

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

      I appreciate those kind words 😀. Happy to hear I could be of some inspiration.

  • @mercadodiego
    @mercadodiego 4 ปีที่แล้ว +1

    Really well explained. Thanks for the video

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

      Glad it was helpful, Diego!

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

    Short and crisp ! Love it

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

      Thanks Kalyani! Glad you enjoyed it.

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

    Affine scaling multiplies whatever shape you have by the X and Y factors you specify.
    When you scale your shape to a value of zero, it basically means that you scaled your shape down to a point where it no longer exists in the 2D world (its X and Y lengths are zero). So when you try to scale it back up again, the computer no longer has any geometrical reference that describe your shape. It sort of lost memory of the original shape you had. As a result, it cannot scale it up anymore.

  • @mentor7803
    @mentor7803 5 ปีที่แล้ว +2

    As always simple and perfect you deserve more recognition 🤩 best content in youtube , "mobarak" 👌🏾👌🏾👌🏾

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

      Thanks Mobarak 😀

  • @Don-rf1ij
    @Don-rf1ij 5 ปีที่แล้ว

    If the scale is zero, it tries to divide the currentTransform by 0 which equals to an error/infinity, that's why it causes problem and you should use 0.01 or 0.001, at least a number which is positive and bigger than 0.

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

    thanks sean, it is helpful as always

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

      Happy to help 😀

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

    Nice video Sean

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

      Thanks SUDO!

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

    Great tutorial 😊

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

      Glad you liked it!

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

    Wow 🤩

  • @MikaelaCaron
    @MikaelaCaron 5 ปีที่แล้ว +2

    Swift animations!
    P. S.
    Great video Sean!

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

      Thanks Caleb!

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

    I am pretty sure you cannot set it to 0 because of division by zero in the transformation matrices used by CGAffineTransform.

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

      Thanks. I learned something today 😀

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

    Nice video 👏👏

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

      Glad you liked it, Govind 😀

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

    Great video

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

      Thanks Siddharth. Glad you enjoyed it.

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

    Some thoughts,
    If the .xib is constrained based, maybe changing a constraint value is better. You might even have broken constraints.
    Animator holds closures of animations and closures hold self. I smell retain cycles! Maybe a capture list with self is required. 🙂
    Nice example!

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

      It's not a .xib, but animating constraint is probably better. You don't need capture lists for the animation framework closures.

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

    Nice!

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

      Glad you liked it!

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

    Good Tutorial

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

      Thanks Sourish!

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

    Thanks for helpful tutorial. Isn't self in closure cause a retain cycle? I think [weak self] is needed here, am I wrong?

    • @seanallen
      @seanallen  5 ปีที่แล้ว +2

      Not in animation closures. There are certain types of closures that don't require it. GCD is another example.

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

    HI Sean thanks for the tutorial. Instead of using:
    self.planetImageView.frame.origin.y -= 400
    I want to use self.planetImageView.transform = CGAffineTransform(translationX: 0, y: -400)
    Is this possible to do? When I try this it will work but it will not work with the delay and will also translate the image from below the screen to the top of the screen instead of starting in the middle of the screen and going up.

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

    Great content!. When your course gonna be released Sean?

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

      Thanks Mohamed! Pre-sales will go live next week and I'm aiming to have the course available around the new year.

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

    Hi sean! How to stop an animation after certain point. I want inverse of the delay factor. Any idea?

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

      I'm not sure exactly what type of behavior you are looking for. But why not set the end animation value of that specific animation to the value you want it to stop at? For example, 80% opacity instead of 100%

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

    any computer vision(matrix) process that multiply to 0 will be optimised (skipped), so probably thats why the transform didnt exist

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

      Thanks. I learned something today 😀

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

    Amazing 👍

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

      Glad you liked it!

  • @mayur.bendale
    @mayur.bendale 5 ปีที่แล้ว +1

    Great 👍

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

      Glad you liked it 😀

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

    Regarding your question about scaling by 0: stackoverflow.com/questions/25964224/cgaffinetransformscale-not-working-with-zero-scale

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

      Thanks for sharing that, Mihai! I learned something today 😀

  • @WeLoveYouFREEZbY
    @WeLoveYouFREEZbY 4 ปีที่แล้ว +1

    is it really that simple?👌 ofc like 👍

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

      Glad you enjoyed it, Sasha!

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

    you don't need to use a property animator to do this

  • @RajKumar-zn2zk
    @RajKumar-zn2zk 4 ปีที่แล้ว +1

    I get you Xcode. Calm down🤣🤣🤣🤣

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

    Great tutorial 👍🏻

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

      Glad you liked it!

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

      @@seanallen Maybe off topic but i have problems with an image and labels. I use an image and using labels on top of it. I aligned them with constraints. Looking in the storyboard everything is fine but when i run the app via the simulator the image is misaligned with the labels. Do you know what the problem could be? THANKS!