四、SwiftUI之ViewModifier

### 什么是ViewModifier?

按照惯例,我们先看下官方文档说明

/// A modifier that you apply to a view or another view modifier, producing a
/// different version of the original value.

翻译为

什么是ViewModifier?

按照惯例,我们先看下官方文档说明

/// A modifier that you apply to a view or another view modifier, producing a
/// different version of the original value.

翻译为

应用于视图或其他视图修改器的修改器,
产生原始值的不同版本。

可以理解为它对原始的视图做了一层自定义的二次封装

什么场景下需要使用它?

HStack {
  Text("a").foregroundColor(Color.red).font(Font.callout).cornerRadius(3).background(Color.green)
  Text("b").foregroundColor(Color.red).font(Font.callout).cornerRadius(3).background(Color.green)
  Text("c").foregroundColor(Color.red).font(Font.callout).cornerRadius(
上一篇:干货 | 一文搞懂PostgreSQL中VACUUM


下一篇:PostgreSQL VACUUM 没有效果(无法清理死元组)的原因