我在哪里可以看到swiftUI的源代码?

我在哪里可以看到swiftUI的源代码?,swift,swiftui,Swift,Swiftui,你能看到更详细的代码吗 @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @frozen public struct HStack<Content> : View where Content : View { /// Creates a horizontal stack with the given spacing and vertical alignment. /// /// - Pa

你能看到更详细的代码吗

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
@frozen public struct HStack<Content> : View where Content : View {

    /// Creates a horizontal stack with the given spacing and vertical alignment.
    ///
    /// - Parameters:
    ///   - alignment: The guide for aligning the subviews in this stack. This
    ///     guide has the same vertical screen coordinate for every child view.
    ///   - spacing: The distance between adjacent subviews, or `nil` if you
    ///     want the stack to choose a default distance for each pair of
    ///     subviews.
    ///   - content: A view builder that creates the content of this stack.
    @inlinable public init(alignment: VerticalAlignment = .center, spacing: CGFloat? = nil, @ViewBuilder content: () -> Content)

    /// 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.
    public typealias Body = Never
}
@可用(iOS 13.0、macOS 10.15、tvOS 13.0、watchOS 6.0、*)
@冻结的公共结构HStack:视图,其中内容:视图{
///创建具有给定间距和垂直对齐的水平堆栈。
///
///-参数:
///-对齐:用于对齐此堆栈中的子视图的指南。此
///对于每个子视图,“指南”具有相同的垂直屏幕坐标。
///-间距:相邻子视图之间的距离,如果需要,则为“零”
///希望堆栈为每对对象选择默认距离
///子视图。
///-内容:创建此堆栈内容的视图生成器。
@可插入的公共初始化(对齐方式:垂直对齐=.center,间距:CGFloat?=nil,@ViewBuilder content:()->content)
///表示此视图主体的视图类型。
///
///创建自定义视图时,Swift会根据您的
///所需“body”属性的实现。
public typealias Body=Never
}

苹果的大多数框架都是封闭源代码的,您只能看到这些公共标题

也有例外(比如达尔文内核是开源的),Swift语言本身也是开源的,但是框架本身(比如SwiftUI)是封闭的

苹果的许多开源计划(如Swift语言)可以在其GitHub页面上找到:


同样值得一提的是,有一些项目正在进行中,以对一些苹果框架的开源版本进行反向工程/重新创建,这可以让您了解如何构建这些框架。举个例子:OpenCombine

SwiftUI不包括在开源Swift项目中,但有一个正在进行的项目是构建苹果SwiftUI DSL的开源实现。

这是否回答了您的问题?