Skip to content

Instantly share code, notes, and snippets.

@arkivanov
Created June 9, 2020 12:54
Show Gist options
  • Select an option

  • Save arkivanov/90f3a4cd3befbb0c1fd3b324a931a1b9 to your computer and use it in GitHub Desktop.

Select an option

Save arkivanov/90f3a4cd3befbb0c1fd3b324a931a1b9 to your computer and use it in GitHub Desktop.
struct KittenSwiftView: View {
@ObservedObject var proxy: KittenViewProxy
var body: some View {
NavigationView {
content
.navigationBarTitle("Kittens KMP Sample")
.navigationBarItems(
leading: ActivityIndicator(isAnimating: self.proxy.model?.isLoading ?? false, style: .medium),
trailing: Button("Refresh") {
self.proxy.dispatch(event: KittenViewEvent.RefreshTriggered())
}
)
}
}
private var content: some View {
// Omitted code
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment