     private func initiateProgressbar(maxvalue: Double) {
         self.progressdelete.isHidden = false
         self.progressdelete.maxValue = maxvalue
+        self.snapshotstodelete = maxvalue
         self.progressdelete.minValue = 0
         self.progressdelete.doubleValue = 0
         self.progressdelete.startAnimation(self)

    private var snapshotsloggdata: SnapshotsLoggData?
    private var delete: Bool = false
    private var numbersinsequencetodelete: Int?
    private var index: Int?
    var lastindex: Int?
    var diddissappear: Bool = false

extension ViewControllerSnapshots: UpdateProgress {
    func processTermination() {
        if delete {
            if self.snapshotsloggdata!.remotecatalogstodelete == nil {
                // self.updateProgressbar(self.snapshotstodelete)
                self.delete = false
                self.progressdelete.isHidden = true
                self.deletebutton.isEnabled = true
