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 {
|
2023-05-18 22:45:12 +00:00
|
|
|
var plugin: InAppWebViewFlutterPlugin?
|
|
|
|
var jobs: [String: PrintJobController?] = [:]
|
2022-10-17 00:23:05 +00:00
|
|
|
|
2023-05-18 22:45:12 +00:00
|
|
|
public init(plugin: InAppWebViewFlutterPlugin?) {
|
2022-10-17 00:23:05 +00:00
|
|
|
super.init()
|
2023-05-18 22:45:12 +00:00
|
|
|
self.plugin = plugin
|
2022-10-17 00:23:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public func dispose() {
|
2023-05-18 22:45:12 +00:00
|
|
|
let jobValues = jobs.values
|
|
|
|
jobValues.forEach { (job: PrintJobController?) in
|
2022-10-17 00:23:05 +00:00
|
|
|
job?.dispose()
|
|
|
|
}
|
2023-05-18 22:45:12 +00:00
|
|
|
jobs.removeAll()
|
|
|
|
plugin = nil
|
2022-10-17 00:23:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
deinit {
|
|
|
|
dispose()
|
|
|
|
}
|
|
|
|
}
|