Jelajahi Sumber

cleanup, remove empty didReceiveMemoryWarning

B. Petersen 5 tahun lalu
induk
melakukan
bfce0fcdec

+ 0 - 4
deltachat-ios.xcodeproj/project.pbxproj

@@ -99,7 +99,6 @@
 		6795F63A82E94FF7CD2CEC0F /* Pods_deltachat_iosTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F7009234DB9408201A6CDCB /* Pods_deltachat_iosTests.framework */; };
 		7070FB9B2101ECBB000DC258 /* NewGroupController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7070FB9A2101ECBB000DC258 /* NewGroupController.swift */; };
 		7092474120B3869500AF8799 /* ContactDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7092474020B3869500AF8799 /* ContactDetailViewController.swift */; };
-		70B08FCD21073B910097D3EA /* NewGroupMemberChoiceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70B08FCC21073B910097D3EA /* NewGroupMemberChoiceController.swift */; };
 		70B8882E2091B8550074812E /* ContactCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70B8882D2091B8550074812E /* ContactCell.swift */; };
 		7837B64021E54DC600CDE126 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = 7837B63F21E54DC600CDE126 /* .swiftlint.yml */; };
 		785BE16821E247F1003BE98C /* MessageInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 785BE16721E247F1003BE98C /* MessageInfoViewController.swift */; };
@@ -344,7 +343,6 @@
 		6241BE1534A653E79AD5D01D /* Pods_deltachat_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_deltachat_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		7070FB9A2101ECBB000DC258 /* NewGroupController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewGroupController.swift; sourceTree = "<group>"; };
 		7092474020B3869500AF8799 /* ContactDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactDetailViewController.swift; sourceTree = "<group>"; };
-		70B08FCC21073B910097D3EA /* NewGroupMemberChoiceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewGroupMemberChoiceController.swift; sourceTree = "<group>"; };
 		70B8882D2091B8550074812E /* ContactCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactCell.swift; sourceTree = "<group>"; };
 		7837B63F21E54DC600CDE126 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .swiftlint.yml; sourceTree = "<group>"; };
 		785BE16721E247F1003BE98C /* MessageInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageInfoViewController.swift; sourceTree = "<group>"; };
@@ -685,7 +683,6 @@
 				7A9FB14A1FB061E2001FEA36 /* Assets.xcassets */,
 				7A9FB14C1FB061E2001FEA36 /* LaunchScreen.storyboard */,
 				7A9FB14F1FB061E2001FEA36 /* Info.plist */,
-				70B08FCC21073B910097D3EA /* NewGroupMemberChoiceController.swift */,
 			);
 			path = "deltachat-ios";
 			sourceTree = "<group>";
@@ -1180,7 +1177,6 @@
 				3040F460234F419400FA34D5 /* BasicAudioController.swift in Sources */,
 				305962082346125100C80F33 /* MediaMessageSizeCalculator.swift in Sources */,
 				AE52EA20229EB9F000C586C9 /* EditGroupViewController.swift in Sources */,
-				70B08FCD21073B910097D3EA /* NewGroupMemberChoiceController.swift in Sources */,
 				AE18F294228C602A0007B1BE /* SecuritySettingsController.swift in Sources */,
 				305961FD2346125100C80F33 /* TypingBubble.swift in Sources */,
 				305961D72346125100C80F33 /* MessageKit+Availability.swift in Sources */,

+ 0 - 2
deltachat-ios/AppDelegate.swift

@@ -20,8 +20,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     var appCoordinator: AppCoordinator!
     var relayHelper: RelayHelper!
     var locationManager: LocationManager!
-    // static let appCoordinatorDeprecated = AppCoordinatorDeprecated()
-    static var progress: Float = 0 // TODO: delete
     private var backgroundTask: UIBackgroundTaskIdentifier = .invalid
 
     var reachability = Reachability()!

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

@@ -276,9 +276,7 @@ class ContactDetailViewController: UITableViewController {
         self.showChat(chatId: chatId)
     }
 
-
     // MARK: - coordinator
-
     func showChat(chatId: Int) {
         if let navigationController = self.parent as? UINavigationController {
             let chatViewController = ChatViewController(dcContext: viewModel.context, chatId: chatId)

+ 2 - 11
deltachat-ios/Controller/EditGroupViewController.swift

@@ -109,11 +109,11 @@ class EditGroupViewController: UITableViewController, MediaPickerDelegate {
     }
 
     private func galleryButtonPressed(_ action: UIAlertAction) {
-        showPhotoPicker(delegate: self)
+        mediaPicker?.showPhotoGallery(delegate: self)
     }
 
     private func cameraButtonPressed(_ action: UIAlertAction) {
-        showCamera(delegate: self)
+        mediaPicker?.showCamera(delegate: self)
     }
 
     func onImageSelected(image: UIImage) {
@@ -131,15 +131,6 @@ class EditGroupViewController: UITableViewController, MediaPickerDelegate {
     }
 
     // MARK: - coordinator
-
-    func showPhotoPicker(delegate: MediaPickerDelegate) {
-        mediaPicker?.showPhotoGallery(delegate: delegate)
-    }
-
-    func showCamera(delegate: MediaPickerDelegate) {
-        mediaPicker?.showCamera(delegate: delegate)
-    }
-
     func navigateBack() {
         if let navigationController = self.parent as? UINavigationController {
             navigationController.popViewController(animated: true)

+ 0 - 5
deltachat-ios/Controller/GroupMembersViewController.swift

@@ -39,10 +39,6 @@ class NewGroupAddMembersViewController: GroupMembersViewController {
         super.viewWillAppear(animated)
     }
 
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-
     @objc func cancelButtonPressed() {
         navigationController?.popViewController(animated: true)
     }
@@ -223,7 +219,6 @@ class AddGroupMembersViewController: GroupMembersViewController {
     }
 
     // MARK: - coordinator
-
     func showNewContactController() {
         if let navigationController = self.parent as? UINavigationController {
             let newContactController = NewContactController(dcContext: dcContext)

+ 0 - 6
deltachat-ios/Controller/NewChatViewController.swift

@@ -122,11 +122,6 @@ class NewChatViewController: UITableViewController {
         dismiss(animated: true, completion: nil)
     }
 
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
-
     // MARK: - Table view data source
 
     override func numberOfSections(in _: UITableView) -> Int {
@@ -333,7 +328,6 @@ class NewChatViewController: UITableViewController {
     }
 
     // MARK: - coordinator
-
     func showNewGroupController(isVerified: Bool) {
         if let navigationController = self.parent as? UINavigationController {
             let newGroupController = NewGroupController(dcContext: dcContext, isVerified: isVerified)

+ 0 - 7
deltachat-ios/Controller/NewContactController.swift

@@ -103,14 +103,7 @@ class NewContactController: UITableViewController {
         return cells[row]
     }
 
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
-
-
     // MARK: - coordinator
-
     func navigateBack() {
         if let navigationController = self.parent as? UINavigationController {
             navigationController.popViewController(animated: true)

+ 0 - 6
deltachat-ios/Controller/NewGroupController.swift

@@ -142,11 +142,6 @@ class NewGroupController: UITableViewController, MediaPickerDelegate {
         showGroupChat(chatId: Int(groupChatId))
     }
 
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
-
     override func numberOfSections(in _: UITableView) -> Int {
         return 3
     }
@@ -348,7 +343,6 @@ class NewGroupController: UITableViewController, MediaPickerDelegate {
     }
 
     // MARK: - coordinator
-
     func showGroupChat(chatId: Int) {
         if let navigationController = self.parent as? UINavigationController {
             let chatViewController = ChatViewController(dcContext: dcContext, chatId: chatId)

+ 0 - 5
deltachat-ios/Controller/QrCodeReaderController.swift

@@ -83,11 +83,6 @@ class QrCodeReaderController: UIViewController {
         captureSession.stopRunning()
     }
 
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
-
     // MARK: - setup
     private func setupSubviews() {
         view.layer.addSublayer(videoPreviewLayer)

+ 0 - 1
deltachat-ios/Controller/SettingsController.swift

@@ -443,7 +443,6 @@ internal final class SettingsViewController: UITableViewController {
     }
 
     // MARK: - coordinator
-
     func showEditSettingsController() {
         if let navigationController = self.parent as? UINavigationController {
             let editController = EditSettingsController(dcContext: dcContext)

+ 0 - 2
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -15,8 +15,6 @@ class AppCoordinator: NSObject, Coordinator {
 
     private let appStateRestorer = AppStateRestorer.shared
 
-    private var childCoordinators: [Coordinator] = []
-
     private lazy var tabBarController: UITabBarController = {
         let tabBarController = UITabBarController()
         tabBarController.delegate = appStateRestorer

+ 0 - 7
deltachat-ios/Helper/Protocols.swift

@@ -1,8 +1,6 @@
 import UIKit
 
 protocol Coordinator: class {
-    // var rootViewController: UIViewController { get }
-    // func start()
 }
 
 protocol QrCodeReaderDelegate: class {
@@ -14,8 +12,3 @@ protocol ContactListDelegate: class {
     func accessDenied()
     func deviceContactsImported()
 }
-
-protocol ChatDisplayer: class {
-    func displayNewChat(contactId: Int)
-    func displayChatForId(chatId: Int)
-}

+ 0 - 82
deltachat-ios/NewGroupMemberChoiceController.swift

@@ -1,82 +0,0 @@
-import UIKit
-
-/*
- class ViewController: UIViewController {
- override func viewDidLoad() {
-   super.viewDidLoad()
-
-   let n: CGFloat = 150
-   let l: CGFloat = 40
-   let generalView = UIView()
-   let square = UIView()
-   square.layer.cornerRadius = n / 2
-   let nameLabel = UILabel()
-   nameLabel.text = "Alic Doe"
-   square.translatesAutoresizingMaskIntoConstraints = false
-   nameLabel.translatesAutoresizingMaskIntoConstraints = false
-   generalView.translatesAutoresizingMaskIntoConstraints = false
-
-   view.addSubview(generalView)
-   view.addSubview(square)
-   view.addSubview(nameLabel)
-   generalView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
-   generalView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
-   square.centerXAnchor.constraint(equalTo: generalView.centerXAnchor).isActive = true
-   square.centerYAnchor.constraint(equalTo: generalView.centerYAnchor).isActive = true
-   nameLabel.topAnchor.constraint(equalTo: square.bottomAnchor).isActive = true
-   nameLabel.leadingAnchor.constraint(equalTo: square.leadingAnchor).isActive = true
-
-   square.widthAnchor.constraint(equalToConstant: n).isActive = true
-   square.heightAnchor.constraint(equalToConstant: n).isActive = true
-   nameLabel.widthAnchor.constraint(equalToConstant: n).isActive = true
-   nameLabel.heightAnchor.constraint(equalToConstant: l).isActive = true
-   generalView.widthAnchor.constraint(equalToConstant: n).isActive = true
-   generalView.heightAnchor.constraint(equalToConstant: n + l).isActive = true
-   square.backgroundColor = UIColor.blue
-   nameLabel.backgroundColor = UIColor.green
-   generalView.backgroundColor = UIColor.cyan
-   nameLabel.textColor = UIColor.white
-   nameLabel.font = UIFont.systemFont(ofSize: 14)
-
-   let deleteButton = UIButton()
-   deleteButton.translatesAutoresizingMaskIntoConstraints = false
-
-   let sin45: CGFloat = 0.7071
-   let squareRadius: CGFloat = n / 2
-   let deltaX: CGFloat = sin45 * squareRadius
-   let deltaY: CGFloat = squareRadius - deltaX
-   let deleteButtonWidth: CGFloat = deltaX
-   let deleteButtonHeight: CGFloat = deltaX
-   deleteButton.layer.cornerRadius = deleteButtonWidth / 2
-
-   deleteButton.widthAnchor.constraint(equalToConstant: deleteButtonWidth).isActive = true
-   deleteButton.heightAnchor.constraint(equalToConstant: deleteButtonHeight).isActive = true
-   deleteButton.backgroundColor = UIColor.gray
-   deleteButton.clipsToBounds = true
-
-   deleteButton.layer.borderWidth = 3
-   deleteButton.layer.borderColor = UIColor.white.cgColor
-   deleteButton.setTitle("✕", for: .normal)
-   deleteButton.titleLabel?.font = UIFont.systemFont(ofSize: 30)
-
-   deleteButton.addTarget(self, action: #selector(didPressDeleteButton), for: .touchUpInside)
-
-   square.addSubview(deleteButton)
-   deleteButton.centerYAnchor.constraint(equalTo: square.topAnchor, constant: deltaY).isActive = true
-   deleteButton.centerXAnchor.constraint(equalTo: square.centerXAnchor, constant: deltaX).isActive = true
- }
-
- @objc func didPressDeleteButton() {
-   if view.backgroundColor == UIColor.red {
-     view.backgroundColor = UIColor.white
-   } else {
-     view.backgroundColor = UIColor.red
-   }
- }
-
- override func didReceiveMemoryWarning() {
-   super.didReceiveMemoryWarning()
- }
- }
-
- */