iosWebViewFix/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobManager.swift

32 lines
646 B
Swift
Raw Normal View History

2022-10-17 00:23:05 +00:00
//
// PrintJobManager.swift
// flutter_inappwebview
//
// Created by Lorenzo Pichilli on 09/05/22.
//
import Foundation
public class PrintJobManager: NSObject, Disposable {
var plugin: InAppWebViewFlutterPlugin?
var jobs: [String: PrintJobController?] = [:]
2022-10-17 00:23:05 +00:00
public init(plugin: InAppWebViewFlutterPlugin?) {
2022-10-17 00:23:05 +00:00
super.init()
self.plugin = plugin
2022-10-17 00:23:05 +00:00
}
public func dispose() {
let jobValues = jobs.values
jobValues.forEach { (job: PrintJobController?) in
2022-10-17 00:23:05 +00:00
job?.dispose()
}
jobs.removeAll()
plugin = nil
2022-10-17 00:23:05 +00:00
}
deinit {
dispose()
}
}