Data Flow Through SwiftUI

dumdum·2021년 4월 29일

pdf

Tools for Data Flow

inspiration

  1. data change -> view change, => update view
  2. you should have a Single Source of Truth. Duplicated Source of Truth can lead to bug and inconsistency
    => lift up the data into a common ancestor and let the two children have a reference to it.
    => eliminating inconsistency bug between view and your data. And you can use the tool available in the language to enforcing variant in your data .
    view와 data사이의 불일치에 의한 bug를 제거할 수 있고, tool을 사용해 data를 바꿀 수 있다.

Tools

Property

what
when

@Environment

@Binding

@State

BindableObject

profile
Noteing WIll

0개의 댓글