📜  如何在 SwiftUI 中的 Preview 提供程序中初始化数据 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.554000             🧑  作者: Mango

代码示例1
struct StoryDetails_Previews: PreviewProvider {
    static var previews: some View {
        StoryDetails(
            story: Story(
                id: 1,
                author: 1,
                body: "Testing",
                edited_time: "September 2019",
                pub_date: "October 2018",
                comments: [Comment](),
                story_likes: [StoryLike]()
             )
        )