Skip to content

Instantly share code, notes, and snippets.

Created November 12, 2022 03:14
What would you like to do?
struct ContentView: View {
@StateObject var viewModel = ViewModel()
var body: some View {
VStack {
Image(systemName: "globe")
extension ContentView {
final class ViewModel: ObservableObject {
@Published var style: Style = .hello
var title: String {
switch style {
case .hello: return "Hello World!"
case .welcome: return "Welcome World!"
enum Style {
case hello, welcome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment