美文网首页Swift
swift 学习 Some 、Never View

swift 学习 Some 、Never View

作者: 弑神指 | 来源:发表于2020-10-20 11:11 被阅读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

相关文章

网友评论

    本文标题:swift 学习 Some 、Never View

    本文链接:https://www.haomeiwen.com/subject/iharmktx.html