瀏覽代碼

format closures parameters

B. Petersen 6 年之前
父節點
當前提交
132ef69929

+ 1 - 1
.swiftlint.yml

@@ -22,7 +22,7 @@ identifier_name:
   max_length: 40
 
 line_length:
-  warning: 150
+  warning: 160
   error: 200
   ignores_function_declarations: true
   ignores_comments: true

+ 1 - 2
deltachat-ios/AppDelegate.swift

@@ -276,8 +276,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         UNUserNotificationCenter.current().delegate = self
 
         UNUserNotificationCenter.current()
-            .requestAuthorization(options: [.alert, .sound, .badge]) {
-                granted, _ in
+            .requestAuthorization(options: [.alert, .sound, .badge]) { granted, _ in
                 logger.info("permission granted: \(granted)")
                 guard granted else { return }
                 self.getNotificationSettings()

+ 5 - 8
deltachat-ios/Controller/ChatListController.swift

@@ -39,18 +39,15 @@ class ChatListController: UIViewController {
         super.viewDidAppear(animated)
         let nc = NotificationCenter.default
         msgChangedObserver = nc.addObserver(forName: dcNotificationChanged,
-                                            object: nil, queue: nil) {
-            _ in
+                                            object: nil, queue: nil) { _ in
             self.getChatList()
         }
         incomingMsgObserver = nc.addObserver(forName: dcNotificationIncoming,
-                                             object: nil, queue: nil) {
-            _ in
+                                             object: nil, queue: nil) { _ in
             self.getChatList()
         }
 
-        viewChatObserver = nc.addObserver(forName: dcNotificationViewChat, object: nil, queue: nil) {
-            notification in
+        viewChatObserver = nc.addObserver(forName: dcNotificationViewChat, object: nil, queue: nil) { notification in
             if let chatId = notification.userInfo?["chat_id"] as? Int {
                 self.coordinator?.showChat(chatId: chatId)
             }
@@ -171,7 +168,7 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
         }
 
         // assigning swipe by delete to chats
-        let delete = UITableViewRowAction(style: .destructive, title: String.localized("global_menu_edit_delete_desktop")) { [unowned self] _, indexPath in
+        let delete = UITableViewRowAction(style: .destructive, title: String.localized("global_menu_edit_delete_desktop")) { [unowned self] _, _ in
             let chatId = chatList.getChatId(index: row)
             self.showDeleteChatConfirmationAlert(chatId: chatId)
         }
@@ -187,7 +184,7 @@ extension ChatListController {
             message: nil,
             preferredStyle: .alert
         )
-        alert.addAction(UIAlertAction(title: String.localized("global_menu_edit_delete_desktop"), style: .default, handler: { action in
+        alert.addAction(UIAlertAction(title: String.localized("global_menu_edit_delete_desktop"), style: .default, handler: { _ in
             self.deleteChat(chatId: chatId)
         }))
         alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: nil))

+ 1 - 2
deltachat-ios/Controller/ContactListController.swift

@@ -166,8 +166,7 @@ class ContactListController: UITableViewController {
         let contactId = contactByIndexPath(indexPath).contact.id
 
         // assigning swipe by delete to chats
-        let edit = UITableViewRowAction(style: .default, title: String.localized("global_menu_edit_desktop")) {
-            [unowned self] _, indexPath in
+        let edit = UITableViewRowAction(style: .default, title: String.localized("global_menu_edit_desktop")) { [unowned self] _, _ in
             if self.searchController.isActive {
                 self.searchController.dismiss(animated: false) {
                     self.coordinator?.showContactDetail(contactId: contactId)

+ 1 - 2
deltachat-ios/Controller/DCNavigationController.swift

@@ -43,8 +43,7 @@ final class DCNavigationController: UINavigationController {
             forName: dcNotificationStateChanged,
             object: nil,
             queue: nil
-        ) {
-            notification in
+        ) { notification in
             if let state = notification.userInfo?["state"] {
                 self.setShadow(state as? String)
             }

+ 1 - 2
deltachat-ios/Controller/NewChatViewController.swift

@@ -89,8 +89,7 @@ class NewChatViewController: UITableViewController {
             forName: dcNotificationSecureJoinerProgress,
             object: nil,
             queue: nil
-        ) {
-            notification in
+        ) { notification in
             if let ui = notification.userInfo {
                 if ui["error"] as? Bool ?? false {
                     self.hud?.error(ui["errorMessage"] as? String)