浏览代码

fix indentation in DcShare ChatListCell

cyberta 5 年之前
父节点
当前提交
40affae897
共有 1 个文件被更改,包括 32 次插入32 次删除
  1. 32 32
      DcShare/View/ChatListCell.swift

+ 32 - 32
DcShare/View/ChatListCell.swift

@@ -33,14 +33,14 @@ class ChatListCell: UITableViewCell {
     }()
 
     lazy var subtitleLabel: UILabel = {
-           let label = UILabel()
-           label.textColor = DcColors.middleGray
-           label.lineBreakMode = .byTruncatingTail
-           label.font = .preferredFont(forTextStyle: .subheadline)
-           label.adjustsFontForContentSizeCategory = true
+        let label = UILabel()
+        label.textColor = DcColors.middleGray
+        label.lineBreakMode = .byTruncatingTail
+        label.font = .preferredFont(forTextStyle: .subheadline)
+        label.adjustsFontForContentSizeCategory = true
         label.translatesAutoresizingMaskIntoConstraints = false
-           return label
-       }()
+        return label
+    }()
 
     override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
         super.init(style: style, reuseIdentifier: reuseIdentifier)
@@ -90,37 +90,37 @@ class ChatListCell: UITableViewCell {
     }
 
     private func setColor(_ color: UIColor) {
-          avatar.setColor(color)
-      }
+        avatar.setColor(color)
+    }
 
     // use this update-method to update cell in cellForRowAt whenever it is possible - other set-methods will be set private in progress
-      func updateCell(cellViewModel: AvatarCellViewModel) {
-          // subtitle
-          switch cellViewModel.type {
-          case .chat(let chatData):
-              let chat = DcContext.shared.getChat(chatId: chatData.chatId)
-              titleLabel.attributedText = cellViewModel.title.boldAt(indexes: cellViewModel.titleHighlightIndexes, fontSize: titleLabel.font.pointSize)
-              if let img = chat.profileImage {
-                  resetBackupImage()
-                  setImage(img)
-              } else {
-                  setBackupImage(name: chat.name, color: chat.color)
-              }
+    func updateCell(cellViewModel: AvatarCellViewModel) {
+        // subtitle
+        switch cellViewModel.type {
+        case .chat(let chatData):
+            let chat = DcContext.shared.getChat(chatId: chatData.chatId)
+            titleLabel.attributedText = cellViewModel.title.boldAt(indexes: cellViewModel.titleHighlightIndexes, fontSize: titleLabel.font.pointSize)
+            if let img = chat.profileImage {
+                resetBackupImage()
+                setImage(img)
+            } else {
+                setBackupImage(name: chat.name, color: chat.color)
+            }
             subtitleLabel.attributedText = nil
 
-          case .contact(let contactData):
-              let contact = DcContact(id: contactData.contactId)
-              titleLabel.attributedText = cellViewModel.title.boldAt(indexes: cellViewModel.titleHighlightIndexes, fontSize: titleLabel.font.pointSize)
-              if let profileImage = contact.profileImage {
-                  avatar.setImage(profileImage)
-              } else {
+        case .contact(let contactData):
+            let contact = DcContact(id: contactData.contactId)
+            titleLabel.attributedText = cellViewModel.title.boldAt(indexes: cellViewModel.titleHighlightIndexes, fontSize: titleLabel.font.pointSize)
+            if let profileImage = contact.profileImage {
+                avatar.setImage(profileImage)
+            } else {
                 setBackupImage(name: cellViewModel.title, color: contact.color)
-              }
-              subtitleLabel.attributedText = cellViewModel.subtitle.boldAt(indexes: cellViewModel.subtitleHighlightIndexes,
-                                                                           fontSize: subtitleLabel.font.pointSize)
-          default:
+            }
+            subtitleLabel.attributedText = cellViewModel.subtitle.boldAt(indexes: cellViewModel.subtitleHighlightIndexes,
+                                                                         fontSize: subtitleLabel.font.pointSize)
+        default:
             return
 
         }
-      }
+    }
 }