Swift

swift 学习 Some 、Never View

2020-10-20  本文已影响0人  弑神指

父节点(容器) 需要子视图

@frozen public struct ScrollViewReader<Content> : View where Content : View {}
  /// The content and behavior of the view.
 /// 视图的内容和行为
    public var body: some View { get }

叶节点 无需子视图

public struct Label : View {}
/// The type of view representing the body of this view.
///
/// When you create a custom view, Swift infers this type from your
/// implementation of the required `body` property.
/// 表示视图主体的视图类型。
///
/// 当你创建一个自定义视图时,Swift会从你的视图中推断出这个类型
/// 实现所需的“body”属性。
  public typealias Body = Never
上一篇 下一篇

猜你喜欢

热点阅读