Created
April 30, 2020 18:23
-
-
Save azamsharp/a2cd41b82bb05c3d9211bcb90d218f7a to your computer and use it in GitHub Desktop.
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
class TrackingListViewModel: ObservableObject { | |
@Published var trackings = [TrackingViewModel]() | |
func getTrackingData() { | |
Webservice().getCovidTrackingResult { trackingList in | |
if let trackingList = trackingList { | |
DispatchQueue.main.async { | |
self.trackings = trackingList.map(TrackingViewModel.init) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment