|
@@ -28,7 +28,7 @@ import NCCommunication
|
|
|
|
|
|
//MARK: - Main Common
|
|
|
|
|
|
-class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentInteractionControllerDelegate, UITextViewDelegate {
|
|
|
+class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentInteractionControllerDelegate {
|
|
|
@objc static let shared: NCMainCommon = {
|
|
|
let instance = NCMainCommon()
|
|
|
instance.createImagesThemingColor()
|
|
@@ -80,38 +80,6 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
|
|
|
NCMainCommonImages.cellPlayImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "play"), width: 100, height: 100, color: .white)
|
|
|
}
|
|
|
|
|
|
- // MARK: -
|
|
|
-
|
|
|
- func createFolder() {
|
|
|
-
|
|
|
- let appDelegate = UIApplication.shared.delegate as! AppDelegate
|
|
|
- guard let serverUrl = appDelegate.activeServerUrl else { return }
|
|
|
-
|
|
|
- let alertController = UIAlertController(title: NSLocalizedString("_create_folder_on_", comment: ""), message: nil, preferredStyle: .alert)
|
|
|
-
|
|
|
- alertController.addTextField { (textField) in
|
|
|
- //[textField addTarget:self action:@selector(minCharTextFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
|
|
- textField.autocapitalizationType = UITextAutocapitalizationType.sentences
|
|
|
- }
|
|
|
-
|
|
|
- let cancelAction = UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil)
|
|
|
- let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { action in
|
|
|
- if let fileNameFolder = alertController.textFields?.first?.text {
|
|
|
- NCNetworking.shared.createFolder(fileName: fileNameFolder, serverUrl: serverUrl, account: appDelegate.account, urlBase: appDelegate.urlBase, overwrite: false) { (errorCode, errorDescription) in
|
|
|
- if errorCode != 0 {
|
|
|
- NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- //okAction.enabled = NO;
|
|
|
- alertController.addAction(cancelAction)
|
|
|
- alertController.addAction(okAction)
|
|
|
-
|
|
|
- appDelegate.window.rootViewController?.present(alertController, animated: true, completion: nil)
|
|
|
- }
|
|
|
-
|
|
|
//MARK: -
|
|
|
|
|
|
@objc func triggerProgressTask(_ notification: Notification, sectionDataSourceocIdIndexPath: NSDictionary, tableView: UITableView, viewController: UIViewController, serverUrlViewController: String?) {
|