# view + previews

[swift](../../swift) ⟩ [custom](..) ⟩ [snippets]() ⟩ previews

{% tabs %}
{% tab title="💾 程式" %}
📁 MyView

```swift
import SwiftUI

/// MyView
struct MyView: View {
    var body: some View {
        VStack {
            Text("Hello")
        }
    }
}
```

📁 Previews

```swift
// -------------- Previews --------------

struct MyView_Previews: PreviewProvider {
    static var previews: some View {
        MyView()
    }
}
```
{% endtab %}

{% tab title="👥 相關" %}
* [slider](../../swiftui/control/slider "mention")
{% endtab %}
{% endtabs %}
