Wayback Machine
78 captures
25 Jun 2020 - 17 Mar 2026
Feb MAR Apr
26
2020 2021 2022
success
fail
About this capture
COLLECTED BY
Organization: Archive Team
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

History is littered with hundreds of conflicts over the future of a community, group, location or business that were "resolved" when one of the parties stepped ahead and destroyed what was there. With the original point of contention destroyed, the debates would fall to the wayside. Archive Team believes that by duplicated condemned data, the conversation and debate can continue, as well as the richness and insight gained by keeping the materials. Our projects have ranged in size from a single volunteer downloading the data to a small-but-critical site, to over 100 volunteers stepping forward to acquire terabytes of user-created data to save for future generations.

The main site for Archive Team is at archiveteam.org and contains up to the date information on various projects, manifestos, plans and walkthroughs.

This collection contains the output of many Archive Team projects, both ongoing and completed. Thanks to the generous providing of disk space by the Internet Archive, multi-terabyte datasets can be made available, as well as in use by the Wayback Machine, providing a path back to lost websites and work.

Our collection has grown to the point of having sub-collections for the type of data we acquire. If you are seeking to browse the contents of these collections, the Wayback Machine is the best first stop. Otherwise, you are free to dig into the stacks to see what you may find.

The Archive Team Panic Downloads are full pulldowns of currently extant websites, meant to serve as emergency backups for needed sites that are in danger of closing, or which will be missed dearly if suddenly lost due to hard drive crashes or server failures.

Collection: Archive Team: URLs
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20210326093803/https://developer.apple.com/videos/play/wwdc2020/10040
  • Global Nav Open Menu Global Nav Close Menu
  • Apple Developer
Search Developer
Cancel
  • Apple Developer
  • Discover
  • Design
  • Develop
  • Distribute
  • Support
  • Account

Videos

Open Menu Close Menu
  • Collections
  • Topics
  • All Videos

More Videos

Streaming is available in most browsers,
and in the WWDC app.

  • Overview
  • Transcript
  • Data Essentials in SwiftUI

    Data is a complex part of any app, but SwiftUI makes it easy to ensure a smooth, data-driven experience from prototyping to production. Discover @State and @Binding, two powerful tools that can preserve and seamlessly update your Source of Truth. We'll also show you how ObservableObject lets you connect your views to your data model. Learn about some tricky challenges and cool new ways to solve them — directly from the experts! To get the most out of this session, you should be familiar with SwiftUI. Watch “App essentials in SwiftUI” and "Introduction to SwiftUI"

    Resources

    • Have a question? Ask with tag wwdc20-10040
    • Search the forums for tag wwdc20-10040
    • State and Data Flow
      • HD Video
      • SD Video

    Related Videos

    WWDC 2020

    • App essentials in SwiftUI
    • Introduction to SwiftUI
    • Stacks, Grids, and Outlines in SwiftUI
    • Structure your app for SwiftUI previews
    • What's new in SwiftUI
  • Download

    Hello and welcome to WWDC.

    Hello, and welcome to Data Essentials in SwiftUI. I'm Curt Clifton, an engineer on the SwiftUI team. Later I'll be joined by my friends and colleagues, Luca Bernardi and Raj Ramamurthy.

    We're going to cover three main areas in this talk. I'll talk about getting started on the data flow in your SwiftUI app, and cover topics like State and Binding. Then Luca will discuss how you can build on those ideas and more to design the data model for your app. Finally, Raj will share techniques for integrating your data model into your app.

    Along the way, we'll discuss the life cycle of a SwiftUI view and share several cool, new features that make it even easier to model your data. We'll also help you develop a deeper understanding of how value and reference types in Swift interact with data flow in SwiftUI.

    I'll be walking through some basic data flow features in SwiftUI, and we'll cover some questions you should ask yourself whenever you create a new SwiftUI view.

    Luca is really into book clubs. He's so into them that he decided he needed an app to keep track of what each of his clubs is reading and take some notes for their next meeting. I enjoy reading too, and thought it would be fun to work on an app together.

    To get started, I want to prototype the view that represents a book I'm reading.

    When I start on a new view in SwiftUI, there are three key questions I like to think about.

    What data does this view need to do its job? In this example, the view needs a thumbnail of the book cover, the title, the author's name, and the percentage of the book that I've read.

    How will the view manipulate that data? This view just needs to display the data. It doesn't change it.

    Where will the data come from? This is the "Source of Truth".

    In the examples throughout this talk, Luca, Raj and I will use this badge to label the source of truth.

    Ultimate, as we'll see, this question of the source of truth is the most important one in the design of your data model.

    Let's build out this view and see what its source of truth should be.

    So what data does this view need to do its job? The book value provides the name of the cover image, the author and the title.

    The progress value provides the percent complete.

    And how will the view manipulate this data? It just displays the data, it doesn't change it, so these can be "let" properties.

    And where will the data come from? It will be passed in from the superview when the BookCard is instantiated.

    The source of truth is somewhere farther up the view hierarchy. The superview passes the true data in when it instantiates a BookCard.

    A new BookCard is instantiated every time the superview's body executes. The instance lives just long enough for SwiftUI to render it, then it's gone.

    We can visualize the internal structure using a diagram. The boxes on the left represent the SwiftUI views that are composed to build this BookCard.

    The capsules on the right represent the data that's used to render the views. We'll return to diagrams like this throughout the talk.

    Next, I'd like to look at a slightly more interesting view. When I tap on a book, the app takes me to this screen where I can review my progress. I want to add a way to update my progress, and add notes when I tap on the "Update Progress" button. Something like this.

    Let's look at how the parent view and this sheet work together.

    We'll focus on how the sheet is presented.

    When the user taps the "Update Progress" button, we'll call the presentEditor method. It will mutate some state to cause the sheet to appear.

    What data does this view need to control the presentation of the sheet? We need a Boolean to keep track of whether the sheet is presented, and we need a String to keep track of the note, and a Double to track the progress.

    Whenever I have multiple related properties like this, I like to pull them out into their own struct.

    Besides making BookView more readable, there are two other great things about this approach. We get all the benefits of encapsulation. EditorConfig can maintain invariants on its properties and be tested independently.

    And because EditorConfig is a value type, any change to a property of EditorConfig, like its progress, is visible as a change to EditorConfig itself.

    Our next question is, how will the view manipulate this data? When the "Update" button is tapped, we'll need to set isEditorPresented to "True" and update progress to match the current progress.

    Because we extracted the state into the EditorConfig struct, we can make it responsible for those updates, and just have the BookView ask the EditorConfig to do the work.

    Then, we'll add a mutating method to EditorConfig, like so.

    And where will the data come from? Well, the editor configuration is local to this view. There isn't some parent view that can pass it in, so we need to establish a local source of truth. The simplest source of truth in SwiftUI is State.

    When we mark this property as State, SwiftUI takes over managing its storage. Let's look at that as a diagram.

    Again, we have the views represented by these boxes on the left, and the data by a capsule on the right.

    Notice that the capsule has a thick border. I'm using this border to indicate data that's managed by SwiftUI for us.

    Why is that important? Well, remember that our views only exist transiently. After SwiftUI completes a rendering pass, the structs themselves go away.