فهرست منبع

clean up MediaPickerDelegate protocol

cyberta 5 سال پیش
والد
کامیت
4bb1122266

+ 0 - 2
deltachat-ios/Controller/EditSettingsController.swift

@@ -165,8 +165,6 @@ class EditSettingsController: UITableViewController, MediaPickerDelegate {
         self.tableView.endUpdates()
     }
 
-    func onDismiss() { }
-
     private func createPictureAndNameCell() -> AvatarSelectionCell {
         let cell = AvatarSelectionCell(context: dcContext)
         return cell

+ 0 - 4
deltachat-ios/Controller/GroupNameController.swift

@@ -168,8 +168,4 @@ class GroupNameController: UITableViewController, MediaPickerDelegate {
         self.tableView.endUpdates()
     }
 
-    func onDismiss() {
-        
-    }
-
 }

+ 2 - 4
deltachat-ios/Helper/MediaPicker.swift

@@ -4,9 +4,7 @@ import MobileCoreServices
 import ALCameraViewController
 
 protocol MediaPickerDelegate: class {
-    //func onMediaSelected(url: NSURL)
     func onImageSelected(image: UIImage)
-    func onDismiss()
 }
 
 class MediaPicker: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate {
@@ -28,7 +26,7 @@ class MediaPicker: NSObject, UINavigationControllerDelegate, UIImagePickerContro
                                                                             if let image = image {
                                                                                 self?.delegate?.onImageSelected(image: image)
                                                                             }
-                                                                            self?.navigationController.dismiss(animated: true, completion: delegate.onDismiss)})
+                                                                            self?.navigationController.dismiss(animated: true, completion: nil)})
         self.delegate = delegate
         navigationController.present(controller, animated: true, completion: nil)
     }
@@ -47,7 +45,7 @@ class MediaPicker: NSObject, UINavigationControllerDelegate, UIImagePickerContro
                                                                 if let image = image {
                                                                     self?.delegate?.onImageSelected(image: image)
                                                                 }
-                                                                self?.navigationController.dismiss(animated: true, completion: self?.delegate?.onDismiss)})
+                                                                self?.navigationController.dismiss(animated: true, completion: nil)})
             self.delegate = delegate
             navigationController.present(cameraViewController, animated: true, completion: nil)
         } else {