     case NotAuthorized
 }
 
+// swiftlint:disable:next type_body_length
 class ViewController: UIViewController, UITextFieldDelegate {
     @IBOutlet weak var host: UITextField!
     @IBOutlet weak var port: UITextField!


                self.updateStatus("Uploading complete successfully.")

                if(self.deleteFilesSwitch.on) {
                    NSLog("Set of files to be kept: " + filesToBeKept.joinWithSeparator(", "))

                    let remoteDirectoryListing = sftpSession!.contentsOfDirectoryAtPath(self.remoteDir.text!)
                    var filesAlreadyRemote = Set<String>()
                    for remoteFile in remoteDirectoryListing as! [NMSFTPFile] {
                        if !remoteFile.isDirectory {
                            filesAlreadyRemote.insert(remoteFile.filename)
                        }
                    }

                    NSLog("Remote directory listing: " + filesAlreadyRemote.joinWithSeparator(", "))

                    let filesToRemove = filesAlreadyRemote.subtract(filesToBeKept)

                    NSLog("Files to remove: " + filesToRemove.joinWithSeparator(", "))

                    for fileToRemove in filesToRemove {
                        let fullFilePath = self.remoteDir.text! + "/" + fileToRemove
                        self.updateStatus("Removing remote file " + fullFilePath)
                        sftpSession!.removeFileAtPath(fullFilePath)
                    }
                }

                self.updateStatus("Disconnecting...")


        self.deleteFilesSwitch.setOn(false, animated: false)

        self.statusText.contentInset = UIEdgeInsets(top: 0, left: -self.statusText.textContainer.lineFragmentPadding, bottom: 0, right: -self.statusText.textContainer.lineFragmentPadding)
    }

    func checkAuthorization() {
