The one trick every iOS developer should know for working with Stack Views

Sdílet
Vložit
  • čas přidán 13. 07. 2024
  • In this video we look at a great trick for making sure your UIStackViews layout properly, with no ambiguity in Auto Layout.
    Level Up Courses
    Level Up AutoLayout
    www.udemy.com/course/level-up...
    Level Up in Swift
    www.udemy.com/course/level-up...
    Data Structures & Algorithms
    www.udemy.com/course/the-swif...
    Twitter
    @jrasmusson
  • Věda a technologie

Komentáře • 22

  • @wolvrG
    @wolvrG Před rokem

    This has been a live saver. I am using programatically UI and was eating my head figuring out where I am doing wrong. Finally fixed it. Thanks a lot

  • @captainmichaelj2321
    @captainmichaelj2321 Před 2 lety +1

    This is absolutely fantastic trick, I am a beginner developer and have been using storyboards and stackviews. Definitely very useful! thanks for the video.

  • @DaveJacobseniOS
    @DaveJacobseniOS Před 2 lety

    Beautiful! Thanks as always.

  • @pulisichhh
    @pulisichhh Před rokem

    Thank you so much, I just had the same problem. For some reason if say a vertical stackview has verical and horizontal intrinsic content sizes it will break even if setting it as lessthanequal to its container. Setting the priority to anything less than required removes the conflict and also applies it.
    I guess USV has some default constraints @ 1000 which create a temporal conflict at compile time but gets fixed at run time, either way it's better to avoid ambiguity. Thanks again!

  • @RomaAnistratenko
    @RomaAnistratenko Před 2 lety

    Thanks for this neat trick !

  • @user-tq4fv8ie6q
    @user-tq4fv8ie6q Před 2 lety

    Useful nugget, thanks

  • @vikas_.
    @vikas_. Před 2 lety

    I learnt something new. I was literally getting these error when ever i do a UI implementation

    • @swiftarcade7632
      @swiftarcade7632  Před 2 lety +1

      You are very welcome Sinamsetty. Thanks for stopping by.

  • @3ilz
    @3ilz Před 2 lety

    How would you do this programmatically?!

    • @swiftarcade7632
      @swiftarcade7632  Před 2 lety +1

      You would create an extension like this and set the priority on the constraint to be something less than 1000.
      public extension NSLayoutConstraint {
      @objc public func setActiveBreakable(priority: UILayoutPriority = UILayoutPriority(900)) {
      self.priority = priority
      isActive = true
      }
      }

  • @shurale85
    @shurale85 Před 2 lety

    Great! and pls less music, u have nice diction, so no need for background sound)

  • @tylerluck1485
    @tylerluck1485 Před 2 lety

    Hi Jonathan,
    Is there a way I can contact you relating to a consulting opportunity?
    Thank you,
    Tyler

    • @swiftarcade7632
      @swiftarcade7632  Před 2 lety

      Hi Tyler - I am pretty busy at the moment. But if you are still interested around March in the new year drop me a new and we can chat. Cheers.

    • @tylerluck1485
      @tylerluck1485 Před 2 lety

      @@swiftarcade7632 Jonathan, thanks so much for the reply! *and no problem on your availability for next year. Would you open to 15 minutes this week for a chat? (Again, I understand you’d be aiming for next year). Thank you, Tyler

  • @aleksekokorev
    @aleksekokorev Před rokem

    1. Please, record only the xcode window, not the all desktop. 2. The mouse pointer would be easier to follow (visually), if it will be highlighted. Also, would be a very nice to highlight the mouse clicking.