![]() ![]() But view preferences are the solution to sending data the “wrong” way in SwiftUI. At first glance, it’s an oddly named, sparsely documented and easily dismissed part of the framework. Instead, there are SwiftUI view preferences. ![]() There’s no responder chain, delegates or superview referencing in SwiftUI like there is in UIKit. ![]() Now and then, however, it’s really useful for an ancestor view to get some information back in the opposite direction. Relevant information flows from the root view down to the descendant views a list knows about all of the entries it contains, but a single cell only knows about one entry, and the name label in that cell only knows about a single piece of text. You write a view, which contains other views, which contains further views, and so on. Much has been said about the declarative, top-down nature of SwiftUI.
0 Comments
Leave a Reply. |