Last active
May 7, 2020 03:07
-
-
Save karthironald/dba8813784a6aa818f680f1a4bc33de3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class MenuData: ObservableObject { | |
@Published var menu: [MenuSection] = [] // Will make an announcement when an item is added or remove from this menu array | |
} | |
struct ContentView: View { | |
@ObservedObject var menuData: MenuData = MenuData() // Listener added to receive data changed announcements to refresh the List inside body. | |
var body: some View { | |
List(menuData.menu) { menu in | |
Text(menu.name) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment