 //
 //  ---------------------------------------------------------------------------
 //
-//  © 2014-2020 1024jp
+//  © 2014-2021 1024jp
 //
 //  Licensed under the Apache License, Version 2.0 (the "License");
 //  you may not use this file except in compliance with the License.

        
        super.init(coder: coder)
        
        progress.publisher(for: \.isFinished, options: .initial)
            .filter { $0 }
            .receive(on: DispatchQueue.main)
            .sink { [weak self] _ in self?.done() }
            .store(in: &self.completionSubscriptions)
        
        progress.publisher(for: \.isCancelled, options: .initial)
            .filter { $0 }
            .receive(on: DispatchQueue.main)
            .sink { [weak self] _ in self?.dismiss(nil) }

    
    @objc private dynamic let progress: Progress
    @objc private dynamic let message: String
    private let closesAutomatically: Bool
    
    private var progressSubscriptions: Set<AnyCancellable> = []
    private var completionSubscriptions: Set<AnyCancellable> = []
