element-ios/Riot/Managers/Call/Operations/CallVCDismissOperation.swift

32 lines
791 B
Swift

//
// Copyright 2020-2024 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.
//
import Foundation
class CallVCDismissOperation: AsyncOperation {
private var presenter: CallPresenter
private var callVC: UIViewController
private var completion: (() -> Void)?
init(presenter: CallPresenter,
callVC: UIViewController,
completion: (() -> Void)? = nil) {
self.presenter = presenter
self.callVC = callVC
self.completion = completion
}
override func main() {
presenter.delegate?.callPresenter(presenter, dismissCallViewController: callVC, completion: {
self.finish()
self.completion?()
})
}
}