mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-04-19 13:05:21 +00:00
COVIDSafe code from version 1.1
This commit is contained in:
commit
3640e52eb2
330 changed files with 261540 additions and 0 deletions
26
CovidSafe/Feedback/Sources/GetJMCTargetAction.swift
Normal file
26
CovidSafe/Feedback/Sources/GetJMCTargetAction.swift
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright © 2020 Australian Government All rights reserved.
|
||||
|
||||
import Foundation
|
||||
|
||||
class GetJMCTargeAction: AsyncAction {
|
||||
let onComplete: (Outcome<JMCTarget>) -> Void
|
||||
|
||||
init(onComplete: @escaping (Outcome<JMCTarget>) -> Void) {
|
||||
self.onComplete = onComplete
|
||||
super.init()
|
||||
}
|
||||
|
||||
override func run() {
|
||||
do {
|
||||
let target = try JMCTarget.createTargetFromJSONOnDisk()
|
||||
finishedExecutingOperationWithOutcome(.success(target))
|
||||
} catch {
|
||||
finishedExecutingOperationWithOutcome(.error(error))
|
||||
}
|
||||
}
|
||||
|
||||
func finishedExecutingOperationWithOutcome(_ outcome: Outcome<JMCTarget>) {
|
||||
finishedExecutingOperation()
|
||||
onComplete(outcome)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue