The one trick every iOS developer should know for working with Stack Views
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
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
This is absolutely fantastic trick, I am a beginner developer and have been using storyboards and stackviews. Definitely very useful! thanks for the video.
Thanks Captain. May it serve you well :)
Beautiful! Thanks as always.
Most welcome. Thx Dave.
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!
Thanks for this neat trick !
Hey no problem. Most welcome.
Useful nugget, thanks
Most welcome.
I learnt something new. I was literally getting these error when ever i do a UI implementation
You are very welcome Sinamsetty. Thanks for stopping by.
How would you do this programmatically?!
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
}
}
Great! and pls less music, u have nice diction, so no need for background sound)
Thank Shurale85. Will keep that in mind.
Hi Jonathan,
Is there a way I can contact you relating to a consulting opportunity?
Thank you,
Tyler
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.
@@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
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.