Created
September 29, 2020 22:51
-
-
Save nalexn/35d40926e019cadbd4988adb08eb2610 to your computer and use it in GitHub Desktop.
Article_009 https://nalexn.github.io/uikit-switfui/
This file contains hidden or 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
extension HomeViewModel { | |
class Adapter: ObservableObject { | |
let viewModel: HomeViewModel | |
@Published var isLoadingData = false | |
} | |
} | |
struct HomeView: View { | |
let adapter: HomeViewModel.Adapter | |
var body: some View { | |
if adapter.isLoadingData { | |
ProgressView() | |
} | |
Button("Do something!") { | |
self.adapter.viewModel.doSomething() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment