How do Auto Layout Constraints from UIKit translate to the SwiftUI layout system?

Описание к видео How do Auto Layout Constraints from UIKit translate to the SwiftUI layout system?

Missing Auto Layout in SwiftUI - here is what to use instead. I want to give a comparison of the layout system between UIKit and SwiftUI. Auto layout from UIKit is very powerful, but can you actually accomplish the same with SwiftUI? I will go through some of the most common Layout Constraints examples and show you the implementation in UIKit and SwiftUI. This is a great excercise if you want to push your knowledge of SwiftUI to the next level or you just want to test the limits of the SwiftUI layout.

Overview
00:00 introduction
01:54 alignment guides centre in container
03:49 pin alignment guide to top of container
07:20 size constraints
17:41 aspect ratio constraint and the SwiftUI layout protocol
21:35 measuring the view size in SwiftUI with GeometryReader
27:34 layout priority
32:50 intrinsic content size and SwiftUI fixed size
36:21 custom alignment guides
50:31 SwiftUI limitations
53:04 Summary

If you liked what you learned and you want to see more, check out one of my courses!
👨‍💻 my SwiftUI course https://school.swiftyplace.com/course...
👨‍💻 my Core Data and SwiftUI course https://school.swiftyplace.com/course...
👩🏻‍💻 Combine course
https://school.swiftyplace.com/course...

Learn more about the SwiftUI Layout:
- Building Custom Views with SwiftUI https://developer.apple.com/videos/pl...
- https://developer.apple.com/documenta...
- https://swiftui-lab.com/alignment-gui...
- SwiftUI course https://www.swiftyplace.com/courses/s...

Custom layout with the Layout protocol
- Compose custom layouts with SwiftUI https://developer.apple.com/videos/pl...
- https://developer.apple.com/documenta...

⬇️ Project starter files: https://github.com/gahntpo/UikitSwift...

#SwiftUI #UIKit #layout

Комментарии

Информация по комментариям в разработке