Bläddra i källkod

Code cleaning

Bastian van de Wetering 6 år sedan
förälder
incheckning
480076ca7f

+ 7 - 8
deltachat-ios/AppDelegate.swift

@@ -25,10 +25,9 @@ enum ApplicationState {
 
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
-
-	var appCoordinator: AppCoordinator!
+  var appCoordinator: AppCoordinator!
   // static let appCoordinatorDeprecated = AppCoordinatorDeprecated()
-	static var progress: Float = 0	// TODO: delete
+  static var progress: Float = 0 // TODO: delete
   static var lastErrorDuringConfig: String?
   private var backgroundTask: UIBackgroundTaskIdentifier = .invalid
 
@@ -77,14 +76,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     open()
     let isConfigured = dc_is_configured(mailboxPointer) != 0
     // AppDelegate.appCoordinatorDeprecated.setupViewControllers(window: window)
-		self.appCoordinator = AppCoordinator(window: window)
-		appCoordinator.start()
+    appCoordinator = AppCoordinator(window: window)
+    appCoordinator.start()
     UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplication.backgroundFetchIntervalMinimum)
     start()
     registerForPushNotifications()
     if !isConfigured {
-			appCoordinator.presentLoginController()
-			//AppDelegate.appCoordinatorDeprecated.presentAccountSetup(animated: false)
+      appCoordinator.presentLoginController()
+      // AppDelegate.appCoordinatorDeprecated.presentAccountSetup(animated: false)
     }
     return true
   }
@@ -143,7 +142,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     return documentsPath + "/messenger.db"
   }
 
-	func open() {
+  func open() {
     logger.info("open: \(dbfile())")
 
     if mailboxPointer == nil {

+ 4 - 4
deltachat-ios/Controller/AccountSetupController.swift

@@ -574,10 +574,10 @@ class AdvancedSectionHeader: UIView {
 
  // TODO: to add Eye-icon -> uncomment -> add to inputField.rightView
  /*
-     lazy var makeVisibleIcon: UIImageView = {
-     let view = UIImageView(image: )
-     return view
-     }()
+      lazy var makeVisibleIcon: UIImageView = {
+      let view = UIImageView(image: )
+      return view
+      }()
   */
  init() {
  super.init(style: .default, reuseIdentifier: nil)

+ 20 - 26
deltachat-ios/Controller/ChatDetailViewController.swift

@@ -11,36 +11,30 @@ import UIKit
 // TODO: checkout if it makes sense to  run group chats and single chats within this chatDetailViewController or maybe seperate these
 
 class ChatDetailViewController: UIViewController {
+  weak var coordinator: ChatDetailCoordinator?
 
-	weak var coordinator: ChatDetailCoordinator?
+  init(chatId _: Int) {
+    super.init(nibName: nil, bundle: nil)
+  }
 
+  required init?(coder _: NSCoder) {
+    fatalError("init(coder:) has not been implemented")
+  }
 
-	init(chatId: Int) {
-		super.init(nibName: nil, bundle: nil)
-	}
+  override func viewDidLoad() {
+    super.viewDidLoad()
+    view.backgroundColor = UIColor.white
 
-	required init?(coder aDecoder: NSCoder) {
-		fatalError("init(coder:) has not been implemented")
-	}
+    // Do any additional setup after loading the view.
+  }
 
-	override func viewDidLoad() {
-		super.viewDidLoad()
-		view.backgroundColor = UIColor.white
-
-
-
-		// Do any additional setup after loading the view.
-	}
-
-
-	/*
-	// MARK: - Navigation
-
-	// In a storyboard-based application, you will often want to do a little preparation before navigation
-	override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-	// Get the new view controller using segue.destination.
-	// Pass the selected object to the new view controller.
-	}
-	*/
+  /*
+   // MARK: - Navigation
 
+   // In a storyboard-based application, you will often want to do a little preparation before navigation
+   override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
+   // Get the new view controller using segue.destination.
+   // Pass the selected object to the new view controller.
+   }
+   */
 }

+ 10 - 11
deltachat-ios/Controller/ChatListController.swift

@@ -9,7 +9,7 @@
 import UIKit
 
 class ChatListController: UIViewController {
-	weak var coordinator: ChatListCoordinator?
+  weak var coordinator: ChatListCoordinator?
   var chatList: MRChatList?
 
   lazy var chatTable: UITableView = {
@@ -30,7 +30,7 @@ class ChatListController: UIViewController {
     super.viewWillAppear(animated)
 
     if #available(iOS 11.0, *) {
-			// TODO: check if this is really nessesary - dc navigationController has large titles
+      // TODO: check if this is really nessesary - dc navigationController has large titles
       navigationController?.navigationBar.prefersLargeTitles = true
     }
 
@@ -62,8 +62,8 @@ class ChatListController: UIViewController {
     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)
-	    }
+        self.coordinator?.showChat(chatId: chatId)
+      }
     }
   }
 
@@ -104,8 +104,8 @@ class ChatListController: UIViewController {
   }
 
   @objc func didPressNewChat() {
-		coordinator?.showNewChatController()
-	}
+    coordinator?.showNewChatController()
+  }
 
   func getChatList() {
     guard let chatlistPointer = dc_get_chatlist(mailboxPointer, DC_GCL_NO_SPECIALS, nil, 0) else {
@@ -118,7 +118,6 @@ class ChatListController: UIViewController {
 }
 
 extension ChatListController: UITableViewDataSource, UITableViewDelegate {
-
   func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int {
     guard let chatList = self.chatList else {
       fatalError("chatList was nil in data source")
@@ -165,10 +164,10 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
     return cell
   }
 
-	func tableView(_: UITableView, didSelectRowAt indexPath: IndexPath) {
+  func tableView(_: UITableView, didSelectRowAt indexPath: IndexPath) {
     let row = indexPath.row
-		if let chatId = chatList?.getChatId(index: row) {
-			coordinator?.showChat(chatId: chatId)
-		}
+    if let chatId = chatList?.getChatId(index: row) {
+      coordinator?.showChat(chatId: chatId)
+    }
   }
 }

+ 110 - 118
deltachat-ios/Controller/ChatViewController.swift

@@ -14,8 +14,7 @@ import QuickLook
 import UIKit
 
 class ChatViewController: MessagesViewController {
-
-	weak var coordinator: ChatViewCoordinator?
+  weak var coordinator: ChatViewCoordinator?
 
   let outgoingAvatarOverlap: CGFloat = 17.5
   let loadCount = 30
@@ -40,112 +39,111 @@ class ChatViewController: MessagesViewController {
     }
   }
 
-	required init?(coder _: NSCoder) {
-		fatalError("init(coder:) has not been implemented")
-	}
-
-	override func viewDidLoad() {
-		messagesCollectionView.register(CustomCell.self)
-		super.viewDidLoad()
-		view.backgroundColor = DCColors.chatBackgroundColor
-		let navBarTap = UITapGestureRecognizer(target: self, action: #selector(chatProfilePressed))
-		navigationController?.navigationBar.addGestureRecognizer(navBarTap)
-		if !MRConfig.configured {
-			// TODO: display message about nothing being configured
-			return
-		}
-
-		let chat = MRChat(id: chatId)
-		updateTitleView(title: chat.name, subtitle: chat.subtitle)
-
-		if let image = chat.profileImage {
-			navigationItem.rightBarButtonItem = UIBarButtonItem(image: image, style: .done, target: self, action: #selector(chatProfilePressed))
-		} else {
-			let initialsLabel = InitialsLabel(name: chat.name, color: chat.color, size: 28)
-			navigationItem.rightBarButtonItem = UIBarButtonItem(customView: initialsLabel)
-		}
-
-
-		configureMessageCollectionView()
-
-		if !disableWriting {
-			configureMessageInputBar()
-			messageInputBar.inputTextView.text = textDraft
-			messageInputBar.inputTextView.becomeFirstResponder()
-		}
-
-		loadFirstMessages()
-	}
-
-	override func viewWillAppear(_ animated: Bool) {
-		super.viewWillAppear(animated)
-		configureMessageMenu()
-
-		if #available(iOS 11.0, *) {
-			if disableWriting {
-				navigationController?.navigationBar.prefersLargeTitles = true
-			}
-		}
-
-		let nc = NotificationCenter.default
-		msgChangedObserver = nc.addObserver(
-			forName: dcNotificationChanged,
-			object: nil,
-			queue: OperationQueue.main
-		) { notification in
-			if let ui = notification.userInfo {
-				if self.disableWriting {
-					// always refresh, as we can't check currently
-					self.refreshMessages()
-				} else if let id = ui["message_id"] as? Int {
-					if id > 0 {
-						self.updateMessage(id)
-					}
-				}
-			}
-		}
-
-		incomingMsgObserver = nc.addObserver(
-			forName: dcNotificationIncoming,
-			object: nil, queue: OperationQueue.main
-		) { notification in
-			if let ui = notification.userInfo {
-				if self.chatId == ui["chat_id"] as! Int {
-					let id = ui["message_id"] as! Int
-					if id > 0 {
-						self.insertMessage(MRMessage(id: id))
-					}
-				}
-			}
-		}
-	}
-
-	override func viewWillDisappear(_ animated: Bool) {
-		super.viewWillDisappear(animated)
-
-		let cnt = Int(dc_get_fresh_msg_cnt(mailboxPointer, UInt32(chatId)))
-		logger.info("updating count for chat \(cnt)")
-		UIApplication.shared.applicationIconBadgeNumber = cnt
-
-		if #available(iOS 11.0, *) {
-			if disableWriting {
-				navigationController?.navigationBar.prefersLargeTitles = false
-			}
-		}
-	}
-
-	override func viewDidDisappear(_ animated: Bool) {
-		super.viewDidDisappear(animated)
-
-		setTextDraft()
-		let nc = NotificationCenter.default
-		if let msgChangedObserver = self.msgChangedObserver {
-			nc.removeObserver(msgChangedObserver)
-		}
-		if let incomingMsgObserver = self.incomingMsgObserver {
-			nc.removeObserver(incomingMsgObserver)
-		}
-	}
+  required init?(coder _: NSCoder) {
+    fatalError("init(coder:) has not been implemented")
+  }
+
+  override func viewDidLoad() {
+    messagesCollectionView.register(CustomCell.self)
+    super.viewDidLoad()
+    view.backgroundColor = DCColors.chatBackgroundColor
+    let navBarTap = UITapGestureRecognizer(target: self, action: #selector(chatProfilePressed))
+    navigationController?.navigationBar.addGestureRecognizer(navBarTap)
+    if !MRConfig.configured {
+      // TODO: display message about nothing being configured
+      return
+    }
+
+    let chat = MRChat(id: chatId)
+    updateTitleView(title: chat.name, subtitle: chat.subtitle)
+
+    if let image = chat.profileImage {
+      navigationItem.rightBarButtonItem = UIBarButtonItem(image: image, style: .done, target: self, action: #selector(chatProfilePressed))
+    } else {
+      let initialsLabel = InitialsLabel(name: chat.name, color: chat.color, size: 28)
+      navigationItem.rightBarButtonItem = UIBarButtonItem(customView: initialsLabel)
+    }
+
+    configureMessageCollectionView()
+
+    if !disableWriting {
+      configureMessageInputBar()
+      messageInputBar.inputTextView.text = textDraft
+      messageInputBar.inputTextView.becomeFirstResponder()
+    }
+
+    loadFirstMessages()
+  }
+
+  override func viewWillAppear(_ animated: Bool) {
+    super.viewWillAppear(animated)
+    configureMessageMenu()
+
+    if #available(iOS 11.0, *) {
+      if disableWriting {
+        navigationController?.navigationBar.prefersLargeTitles = true
+      }
+    }
+
+    let nc = NotificationCenter.default
+    msgChangedObserver = nc.addObserver(
+      forName: dcNotificationChanged,
+      object: nil,
+      queue: OperationQueue.main
+    ) { notification in
+      if let ui = notification.userInfo {
+        if self.disableWriting {
+          // always refresh, as we can't check currently
+          self.refreshMessages()
+        } else if let id = ui["message_id"] as? Int {
+          if id > 0 {
+            self.updateMessage(id)
+          }
+        }
+      }
+    }
+
+    incomingMsgObserver = nc.addObserver(
+      forName: dcNotificationIncoming,
+      object: nil, queue: OperationQueue.main
+    ) { notification in
+      if let ui = notification.userInfo {
+        if self.chatId == ui["chat_id"] as! Int {
+          let id = ui["message_id"] as! Int
+          if id > 0 {
+            self.insertMessage(MRMessage(id: id))
+          }
+        }
+      }
+    }
+  }
+
+  override func viewWillDisappear(_ animated: Bool) {
+    super.viewWillDisappear(animated)
+
+    let cnt = Int(dc_get_fresh_msg_cnt(mailboxPointer, UInt32(chatId)))
+    logger.info("updating count for chat \(cnt)")
+    UIApplication.shared.applicationIconBadgeNumber = cnt
+
+    if #available(iOS 11.0, *) {
+      if disableWriting {
+        navigationController?.navigationBar.prefersLargeTitles = false
+      }
+    }
+  }
+
+  override func viewDidDisappear(_ animated: Bool) {
+    super.viewDidDisappear(animated)
+
+    setTextDraft()
+    let nc = NotificationCenter.default
+    if let msgChangedObserver = self.msgChangedObserver {
+      nc.removeObserver(msgChangedObserver)
+    }
+    if let incomingMsgObserver = self.incomingMsgObserver {
+      nc.removeObserver(incomingMsgObserver)
+    }
+  }
 
   @objc
   private func loadMoreMessages() {
@@ -213,8 +211,6 @@ class ChatViewController: MessagesViewController {
     }
   }
 
-
-
   private func setTextDraft() {
     if let text = self.messageInputBar.inputTextView.text {
       let draft = dc_msg_new(mailboxPointer, DC_MSG_TEXT)
@@ -226,8 +222,6 @@ class ChatViewController: MessagesViewController {
     }
   }
 
-
-
   override var inputAccessoryView: UIView? {
     if disableWriting {
       return nil
@@ -236,8 +230,6 @@ class ChatViewController: MessagesViewController {
     return messageInputBar
   }
 
-
-
   private func configureMessageMenu() {
     var menuItems: [UIMenuItem]
 
@@ -360,9 +352,9 @@ class ChatViewController: MessagesViewController {
       }
   }
 
-	@objc private func chatProfilePressed() {
-		coordinator?.showChatDetail(chatId: self.chatId)
-	}
+  @objc private func chatProfilePressed() {
+    coordinator?.showChatDetail(chatId: chatId)
+  }
 
   // MARK: - UICollectionViewDataSource
 
@@ -685,7 +677,7 @@ extension ChatViewController: MessagesDisplayDelegate {
     }
   }
 
-	func configureAvatarView(_ avatarView: AvatarView, for message: MessageType, at indexPath: IndexPath, in _: MessagesCollectionView) {
+  func configureAvatarView(_ avatarView: AvatarView, for message: MessageType, at indexPath: IndexPath, in _: MessagesCollectionView) {
     let message = messageList[indexPath.section]
     let contact = message.fromContact
     let avatar = Avatar(image: contact.profileImage, initials: Utils.getInitials(inputName: contact.name))

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

@@ -9,8 +9,7 @@
 import UIKit
 
 class ContactListController: UITableViewController {
-
-	weak var coordinator: ContactListCoordinator?
+  weak var coordinator: ContactListCoordinator?
 
   let contactCellReuseIdentifier = "xyz"
   var contactIds: [Int] = Utils.getContactIds()

+ 50 - 64
deltachat-ios/Controller/GroupNameController.swift

@@ -9,18 +9,17 @@
 import UIKit
 
 class GroupNameController: UITableViewController {
+  weak var coordinator: GroupNameCoordinator?
 
-	weak var coordinator: GroupNameCoordinator?
-
-	var groupName: String = ""
+  var groupName: String = ""
 
   var doneButton: UIBarButtonItem!
-	let contactIdsForGroup: Set<Int>	// TODO: check if array is sufficient
-	let groupContactIds: [Int]
+  let contactIdsForGroup: Set<Int> // TODO: check if array is sufficient
+  let groupContactIds: [Int]
 
   init(contactIdsForGroup: Set<Int>) {
     self.contactIdsForGroup = contactIdsForGroup
-		self.groupContactIds = Array(contactIdsForGroup)
+    groupContactIds = Array(contactIdsForGroup)
     super.init(style: .grouped)
   }
 
@@ -28,19 +27,17 @@ class GroupNameController: UITableViewController {
     fatalError("init(coder:) has not been implemented")
   }
 
-
   override func viewDidLoad() {
     super.viewDidLoad()
     title = "New Group"
-		doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneButtonPressed))
+    doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneButtonPressed))
     navigationItem.rightBarButtonItem = doneButton
-		tableView.bounces = false
+    tableView.bounces = false
     doneButton.isEnabled = false
-		tableView.register(GroupLabelCell.self, forCellReuseIdentifier: "groupLabelCell")
-		tableView.register(ContactCell.self, forCellReuseIdentifier: "contactCell")
-		// setupSubviews()
-
-	}
+    tableView.register(GroupLabelCell.self, forCellReuseIdentifier: "groupLabelCell")
+    tableView.register(ContactCell.self, forCellReuseIdentifier: "contactCell")
+    // setupSubviews()
+  }
 
   @objc func doneButtonPressed() {
     let groupChatId = dc_create_group_chat(mailboxPointer, 0, groupName)
@@ -54,7 +51,7 @@ class GroupNameController: UITableViewController {
       }
     }
 
-		coordinator?.showGroupChat(chatId: Int(groupChatId))
+    coordinator?.showGroupChat(chatId: Int(groupChatId))
   }
 
   override func didReceiveMemoryWarning() {
@@ -62,62 +59,51 @@ class GroupNameController: UITableViewController {
     // Dispose of any resources that can be recreated.
   }
 
+  override func numberOfSections(in _: UITableView) -> Int {
+    return 2
+  }
 
-	override func numberOfSections(in tableView: UITableView) -> Int {
-		return 2
-
-	}
-
-
-	override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-		let section = indexPath.section
-		let row = indexPath.row
-
-		if section == 0 {
-			let cell = tableView.dequeueReusableCell(withIdentifier: "groupLabelCell", for: indexPath) as! GroupLabelCell
-			cell.groupNameUpdated = updateGroupName
+  override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+    let section = indexPath.section
+    let row = indexPath.row
 
-			return cell
+    if section == 0 {
+      let cell = tableView.dequeueReusableCell(withIdentifier: "groupLabelCell", for: indexPath) as! GroupLabelCell
+      cell.groupNameUpdated = updateGroupName
 
-		} else {
-			let cell = tableView.dequeueReusableCell(withIdentifier: "contactCell", for: indexPath) as! ContactCell
+      return cell
 
-			let contact = MRContact(id: groupContactIds[row])
-			cell.nameLabel.text = contact.name
-			cell.emailLabel.text = contact.email
-			cell.initialsLabel.text = Utils.getInitials(inputName: contact.name)
-			cell.setColor(contact.color)
+    } else {
+      let cell = tableView.dequeueReusableCell(withIdentifier: "contactCell", for: indexPath) as! ContactCell
 
-			return cell
-		}
+      let contact = MRContact(id: groupContactIds[row])
+      cell.nameLabel.text = contact.name
+      cell.emailLabel.text = contact.email
+      cell.initialsLabel.text = Utils.getInitials(inputName: contact.name)
+      cell.setColor(contact.color)
 
-	}
+      return cell
+    }
+  }
 
-	override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-		if section == 0 {
-			return 1
-		} else {
-			return contactIdsForGroup.count
-		}
-	}
+  override func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int {
+    if section == 0 {
+      return 1
+    } else {
+      return contactIdsForGroup.count
+    }
+  }
 
-	override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
-		if section == 1 {
-			return "Group Members"
-		} else {
-			return nil
-		}
-	}
+  override func tableView(_: UITableView, titleForHeaderInSection section: Int) -> String? {
+    if section == 1 {
+      return "Group Members"
+    } else {
+      return nil
+    }
+  }
 
-	private func updateGroupName(name: String) {
-		groupName = name
-		doneButton.isEnabled = name.containsCharacters()
-	}
+  private func updateGroupName(name: String) {
+    groupName = name
+    doneButton.isEnabled = name.containsCharacters()
+  }
 }
-
-
-
-
-
-
-

+ 18 - 20
deltachat-ios/Controller/NewChatViewController.swift

@@ -11,7 +11,7 @@ import Contacts
 import UIKit
 
 class NewChatViewController: UITableViewController {
-	weak var coordinator: NewChatCoordinator?
+  weak var coordinator: NewChatCoordinator?
 
   private lazy var searchController: UISearchController = {
     let searchController = UISearchController(searchResultsController: nil)
@@ -67,17 +67,17 @@ class NewChatViewController: UITableViewController {
 
   override func viewDidLoad() {
     super.viewDidLoad()
-		
+
     title = "New Chat"
 
-		deviceContactHandler.importDeviceContacts()
+    deviceContactHandler.importDeviceContacts()
     navigationItem.searchController = searchController
     definesPresentationContext = true // to make sure searchbar will only be shown in this viewController
   }
 
   override func viewWillAppear(_ animated: Bool) {
     super.viewWillAppear(animated)
-		deviceContactAccessGranted = CNContactStore.authorizationStatus(for: .contacts) == .authorized
+    deviceContactAccessGranted = CNContactStore.authorizationStatus(for: .contacts) == .authorized
     contactIds = Utils.getContactIds()
 
     // this will show the searchbar on launch -> will be set back to true on viewDidAppear
@@ -111,11 +111,10 @@ class NewChatViewController: UITableViewController {
     }
   }
 
-	override func viewWillDisappear(_ animated: Bool) {
-		hidesBottomBarWhenPushed = false
-		title = "Chats"	/* hack: when navigating to chatView (removing this viewController), there was a delayed backButton update (showing 'New Chat' for a moment) */
-
-	}
+  override func viewWillDisappear(_: Bool) {
+    hidesBottomBarWhenPushed = false
+    title = "Chats" /* hack: when navigating to chatView (removing this viewController), there was a delayed backButton update (showing 'New Chat' for a moment) */
+  }
 
   override func viewDidDisappear(_ animated: Bool) {
     super.viewDidDisappear(animated)
@@ -244,12 +243,11 @@ class NewChatViewController: UITableViewController {
 
     if section == 0 {
       if row == 0 {
-				coordinator?.showNewGroupController()
-
+        coordinator?.showNewGroupController()
       }
       if row == 1 {
         if UIImagePickerController.isSourceTypeAvailable(.camera) {
-					coordinator?.showQRCodeController()
+          coordinator?.showQRCodeController()
         } else {
           let alert = UIAlertController(title: "Camera is not available", message: nil, preferredStyle: .alert)
           alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: { _ in
@@ -259,7 +257,7 @@ class NewChatViewController: UITableViewController {
         }
       }
       if row == 2 {
-				coordinator?.showNewContactController()
+        coordinator?.showNewContactController()
       }
     } else if section == 1 {
       if deviceContactAccessGranted {
@@ -267,20 +265,20 @@ class NewChatViewController: UITableViewController {
           // edge case: when searchController is active but searchBar is empty -> filteredContacts is empty, so we fallback to contactIds
           let contactId = isFiltering() ? filteredContacts[row].contact.id : contactIds[row]
           searchController.dismiss(animated: false, completion: {
-            	self.coordinator?.showNewChat(contactId: contactId)
-            })
+            self.coordinator?.showNewChat(contactId: contactId)
+          })
         } else {
           let contactId = contactIds[row]
-         		self.coordinator?.showNewChat(contactId: contactId)
-         }
+          coordinator?.showNewChat(contactId: contactId)
+        }
       } else {
         showSettingsAlert()
       }
     } else {
       let contactIndex = row
       let contactId = contactIds[contactIndex]
-     	self.coordinator?.showNewChat(contactId: contactId)
-		}
+      coordinator?.showNewChat(contactId: contactId)
+    }
   }
 
   private func updateContactCell(cell: ContactCell, contactWithHighlight: ContactWithSearchResults) {
@@ -331,7 +329,7 @@ extension NewChatViewController: QrCodeReaderDelegate {
 
         DispatchQueue.main.async {
           self.dismiss(animated: true) {
-						self.coordinator?.showChat(chatId: Int(id))
+            self.coordinator?.showChat(chatId: Int(id))
             // self.chatDisplayer?.displayChatForId(chatId: Int(id))
           }
         }

+ 5 - 7
deltachat-ios/Controller/NewGroupViewController.swift

@@ -9,7 +9,7 @@
 import UIKit
 
 class NewGroupViewController: UITableViewController {
-	weak var coordinator: NewGroupCoordinator?
+  weak var coordinator: NewGroupCoordinator?
 
   let contactCellReuseIdentifier = "xyz"
   var contactIds: [Int] = Utils.getContactIds()
@@ -20,8 +20,6 @@ class NewGroupViewController: UITableViewController {
     }
   }
 
-
-
   override func viewDidLoad() {
     super.viewDidLoad()
     title = "New Group"
@@ -75,8 +73,8 @@ class NewGroupViewController: UITableViewController {
       }
     }
   }
-	
-	@objc func nextButtonPressed() {
-		coordinator?.showGroupNameController(contactIdsForGroup: contactIdsForGroup)
-	}
+
+  @objc func nextButtonPressed() {
+    coordinator?.showGroupNameController(contactIdsForGroup: contactIdsForGroup)
+  }
 }

+ 1 - 1
deltachat-ios/Controller/ProfileViewController.swift

@@ -9,7 +9,7 @@
 import UIKit
 
 class ProfileViewController: UITableViewController {
-	weak var coordinator: ProfileCoordinator?
+  weak var coordinator: ProfileCoordinator?
 
   var contact: MRContact? {
     // This is nil if we do not have an account setup yet

+ 2 - 3
deltachat-ios/Controller/SettingsController.swift

@@ -13,8 +13,7 @@ import QuickTableViewController
 import UIKit
 
 internal final class SettingsViewController: QuickTableViewController {
-
-	weak var coordinator: SettingsCoordinator?
+  weak var coordinator: SettingsCoordinator?
 
   let documentInteractionController = UIDocumentInteractionController()
   var backupProgressObserver: Any?
@@ -276,6 +275,6 @@ internal final class SettingsViewController: QuickTableViewController {
   }
 
   private func presentAccountSetup(_: Row) {
-		coordinator?.showAccountSetupController()
+    coordinator?.showAccountSetupController()
   }
 }

+ 226 - 234
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -9,282 +9,274 @@
 import UIKit
 
 class AppCoordinator: NSObject, Coordinator, UITabBarControllerDelegate {
-
-	private let window: UIWindow
-
-	var rootViewController: UIViewController {
-		return tabBarController
-	}
-
-	private var childCoordinators:[Coordinator] = []
-
-	private lazy var tabBarController: UITabBarController = {
-		let tabBarController = UITabBarController()
-		tabBarController.viewControllers = [contactListController, mailboxController, profileController, chatListController, settingsController]
-		// put viewControllers here
-		tabBarController.delegate = self
-		tabBarController.tabBar.tintColor = DCColors.primary
-		// tabBarController.tabBar.isTranslucent = false
-		return tabBarController
-	}()
-
-	// MARK: viewControllers
-
-	private lazy var contactListController: UIViewController = {
-		let controller = ContactListController()
-		let nav = NavigationController(rootViewController: controller)
-		let settingsImage = UIImage(named: "contacts")
-		nav.tabBarItem = UITabBarItem(title: "Contacts", image: settingsImage, tag: 4)
-		let coordinator = ContactListCoordinator(navigationController: nav)
-		self.childCoordinators.append(coordinator)
-		controller.coordinator = coordinator
-		return nav
-	}()
-
-	private lazy var mailboxController: UIViewController = {
-		let controller = ChatViewController(chatId: Int(DC_CHAT_ID_DEADDROP), title: "Mailbox")
-		controller.disableWriting = true
-		let nav = NavigationController(rootViewController: controller)
-		let settingsImage = UIImage(named: "message")
-		nav.tabBarItem = UITabBarItem(title: "Mailbox", image: settingsImage, tag: 4)
-		let coordinator = MailboxCoordinator(navigationController: nav)
-		self.childCoordinators.append(coordinator)
-		controller.coordinator = coordinator
-		return nav
-	}()
-
-	private lazy var profileController: UIViewController = {
-		let controller = ProfileViewController()
-		let nav = NavigationController(rootViewController: controller)
-		let settingsImage = UIImage(named: "report_card")
-		nav.tabBarItem = UITabBarItem(title: "My Profile", image: settingsImage, tag: 4)
-		let coordinator = ProfileCoordinator(rootViewController: nav)
-		self.childCoordinators.append(coordinator)
-		controller.coordinator = coordinator
-		return nav
-	}()
-
-	private lazy var chatListController: UIViewController = {
-		let controller = ChatListController()
-		let nav = NavigationController(rootViewController: controller)
-		let settingsImage = UIImage(named: "chat")
-		nav.tabBarItem = UITabBarItem(title: "Chats", image: settingsImage, tag: 4)
-		let coordinator = ChatListCoordinator(navigationController: nav)
-		self.childCoordinators.append(coordinator)
-		controller.coordinator = coordinator
-		return nav
-	}()
-
-	private lazy var settingsController: UIViewController = {
-		let controller = SettingsViewController()
-		let nav = NavigationController(rootViewController: controller)
-		let settingsImage = UIImage(named: "settings")
-		nav.tabBarItem = UITabBarItem(title: "Settings", image: settingsImage, tag: 4)
-		let coordinator = SettingsCoordinator(navigationController: nav)
-		self.childCoordinators.append(coordinator)
-		controller.coordinator = coordinator
-		return nav
-	}()
-
-	init(window: UIWindow) {
-		self.window = window
-		super.init()
-		window.rootViewController = rootViewController
-		window.makeKeyAndVisible()
-	}
-
-	public func start() {
-		self.showTab(index: 3)
-	}
-
-	public func showTab(index: Int) {
-		tabBarController.selectedIndex = index
-	}
-
-	public func presentLoginController() {
-		let accountSetupController = AccountSetupController()
-		let accountSetupNavigationController = UINavigationController(rootViewController: accountSetupController)
-		rootViewController.present(accountSetupNavigationController, animated: false, completion: nil)
-	}
+  private let window: UIWindow
+
+  var rootViewController: UIViewController {
+    return tabBarController
+  }
+
+  private var childCoordinators: [Coordinator] = []
+
+  private lazy var tabBarController: UITabBarController = {
+    let tabBarController = UITabBarController()
+    tabBarController.viewControllers = [contactListController, mailboxController, profileController, chatListController, settingsController]
+    // put viewControllers here
+    tabBarController.delegate = self
+    tabBarController.tabBar.tintColor = DCColors.primary
+    // tabBarController.tabBar.isTranslucent = false
+    return tabBarController
+  }()
+
+  // MARK: viewControllers
+
+  private lazy var contactListController: UIViewController = {
+    let controller = ContactListController()
+    let nav = NavigationController(rootViewController: controller)
+    let settingsImage = UIImage(named: "contacts")
+    nav.tabBarItem = UITabBarItem(title: "Contacts", image: settingsImage, tag: 4)
+    let coordinator = ContactListCoordinator(navigationController: nav)
+    self.childCoordinators.append(coordinator)
+    controller.coordinator = coordinator
+    return nav
+  }()
+
+  private lazy var mailboxController: UIViewController = {
+    let controller = ChatViewController(chatId: Int(DC_CHAT_ID_DEADDROP), title: "Mailbox")
+    controller.disableWriting = true
+    let nav = NavigationController(rootViewController: controller)
+    let settingsImage = UIImage(named: "message")
+    nav.tabBarItem = UITabBarItem(title: "Mailbox", image: settingsImage, tag: 4)
+    let coordinator = MailboxCoordinator(navigationController: nav)
+    self.childCoordinators.append(coordinator)
+    controller.coordinator = coordinator
+    return nav
+  }()
+
+  private lazy var profileController: UIViewController = {
+    let controller = ProfileViewController()
+    let nav = NavigationController(rootViewController: controller)
+    let settingsImage = UIImage(named: "report_card")
+    nav.tabBarItem = UITabBarItem(title: "My Profile", image: settingsImage, tag: 4)
+    let coordinator = ProfileCoordinator(rootViewController: nav)
+    self.childCoordinators.append(coordinator)
+    controller.coordinator = coordinator
+    return nav
+  }()
+
+  private lazy var chatListController: UIViewController = {
+    let controller = ChatListController()
+    let nav = NavigationController(rootViewController: controller)
+    let settingsImage = UIImage(named: "chat")
+    nav.tabBarItem = UITabBarItem(title: "Chats", image: settingsImage, tag: 4)
+    let coordinator = ChatListCoordinator(navigationController: nav)
+    self.childCoordinators.append(coordinator)
+    controller.coordinator = coordinator
+    return nav
+  }()
+
+  private lazy var settingsController: UIViewController = {
+    let controller = SettingsViewController()
+    let nav = NavigationController(rootViewController: controller)
+    let settingsImage = UIImage(named: "settings")
+    nav.tabBarItem = UITabBarItem(title: "Settings", image: settingsImage, tag: 4)
+    let coordinator = SettingsCoordinator(navigationController: nav)
+    self.childCoordinators.append(coordinator)
+    controller.coordinator = coordinator
+    return nav
+  }()
+
+  init(window: UIWindow) {
+    self.window = window
+    super.init()
+    window.rootViewController = rootViewController
+    window.makeKeyAndVisible()
+  }
+
+  public func start() {
+    showTab(index: 3)
+  }
+
+  public func showTab(index: Int) {
+    tabBarController.selectedIndex = index
+  }
+
+  public func presentLoginController() {
+    let accountSetupController = AccountSetupController()
+    let accountSetupNavigationController = UINavigationController(rootViewController: accountSetupController)
+    rootViewController.present(accountSetupNavigationController, animated: false, completion: nil)
+  }
 }
 
 class ContactListCoordinator: Coordinator {
-	let navigationController: UINavigationController
+  let navigationController: UINavigationController
 
-	init(navigationController: UINavigationController) {
-		self.navigationController = navigationController
-	}
+  init(navigationController: UINavigationController) {
+    self.navigationController = navigationController
+  }
 }
 
 // since mailbox and chatView -tab both use ChatViewController we want to be able to assign different functionality via coordinators -> therefore we override unneeded functions such as showChatDetail -> maybe find better solution in longterm
 class MailboxCoordinator: ChatViewCoordinator {
-
-	override func showChatDetail(chatId: Int) {
-		// ignore for now
-	}
+  override func showChatDetail(chatId _: Int) {
+    // ignore for now
+  }
 }
 
 class ProfileCoordinator: Coordinator {
-	var rootViewController: UIViewController
+  var rootViewController: UIViewController
 
-	init(rootViewController: UIViewController) {
-		self.rootViewController = rootViewController
-	}
+  init(rootViewController: UIViewController) {
+    self.rootViewController = rootViewController
+  }
 }
 
 class ChatListCoordinator: Coordinator {
-	let navigationController: UINavigationController
-
-	var childCoordinators: [Coordinator] = []
-
-	init(navigationController: UINavigationController) {
-		self.navigationController = navigationController
-	}
-
-	func showNewChatController() {
-		let newChatVC = NewChatViewController()
-		let coordinator = NewChatCoordinator(navigationController: self.navigationController)
-		childCoordinators.append(coordinator)
-		newChatVC.coordinator = coordinator
-		newChatVC.hidesBottomBarWhenPushed = true
-		navigationController.pushViewController(newChatVC, animated: true)
-	}
-
-	func showChat(chatId: Int) {
-		let chatVC = ChatViewController(chatId: chatId)
-		let coordinator = ChatViewCoordinator(navigationController: navigationController)
-		childCoordinators.append(coordinator)
-		chatVC.coordinator = coordinator
-		chatVC.hidesBottomBarWhenPushed = true
-		navigationController.pushViewController(chatVC, animated: true)
-
-	}
+  let navigationController: UINavigationController
+
+  var childCoordinators: [Coordinator] = []
+
+  init(navigationController: UINavigationController) {
+    self.navigationController = navigationController
+  }
+
+  func showNewChatController() {
+    let newChatVC = NewChatViewController()
+    let coordinator = NewChatCoordinator(navigationController: navigationController)
+    childCoordinators.append(coordinator)
+    newChatVC.coordinator = coordinator
+    newChatVC.hidesBottomBarWhenPushed = true
+    navigationController.pushViewController(newChatVC, animated: true)
+  }
+
+  func showChat(chatId: Int) {
+    let chatVC = ChatViewController(chatId: chatId)
+    let coordinator = ChatViewCoordinator(navigationController: navigationController)
+    childCoordinators.append(coordinator)
+    chatVC.coordinator = coordinator
+    chatVC.hidesBottomBarWhenPushed = true
+    navigationController.pushViewController(chatVC, animated: true)
+  }
 }
 
 class SettingsCoordinator: Coordinator {
-	let navigationController: UINavigationController
+  let navigationController: UINavigationController
 
-	init(navigationController: UINavigationController) {
-		self.navigationController = navigationController
-	}
+  init(navigationController: UINavigationController) {
+    self.navigationController = navigationController
+  }
 
-	func showAccountSetupController() {
-		let accountSetupVC = AccountSetupController()
-		accountSetupVC.hidesBottomBarWhenPushed = true
+  func showAccountSetupController() {
+    let accountSetupVC = AccountSetupController()
+    accountSetupVC.hidesBottomBarWhenPushed = true
 
-		navigationController.pushViewController(accountSetupVC, animated: true)
-	}
+    navigationController.pushViewController(accountSetupVC, animated: true)
+  }
 }
 
 class NewChatCoordinator: Coordinator {
-	let navigationController: UINavigationController
-
-	private var childCoordinators:[Coordinator] = []
-
-	init(navigationController: UINavigationController) {
-		self.navigationController = navigationController
-	}
-
-	func showNewGroupController() {
-		let newGroupController = NewGroupViewController()
-		let coordinator = NewGroupCoordinator(navigationController: self.navigationController)
-		childCoordinators.append(coordinator)
-		newGroupController.coordinator = coordinator
-		navigationController.pushViewController(newGroupController, animated: true)
-	}
-
-	func showQRCodeController() {
-		let controller = QrCodeReaderController()
-		// controller.delegate = self
-		//present(controller, animated: true, completion: nil)
-
-	}
-
-	func showNewContactController() {
-		let newContactController = NewContactController()
-		navigationController.pushViewController(newContactController, animated: true)
-	}
-
-	func showNewChat(contactId: Int) {
-		let chatId = dc_create_chat_by_contact_id(mailboxPointer, UInt32(contactId))
-		showChat(chatId: Int(chatId))
-	}
-
-	func showChat(chatId: Int) {
-		let chatViewController = ChatViewController(chatId: chatId)
-		let coordinator = ChatViewCoordinator(navigationController: navigationController)
-		childCoordinators.append(coordinator)
-		chatViewController.coordinator = coordinator
-		self.navigationController.pushViewController(chatViewController, animated: true)
-		navigationController.viewControllers.remove(at: 1)
-	}
+  let navigationController: UINavigationController
+
+  private var childCoordinators: [Coordinator] = []
+
+  init(navigationController: UINavigationController) {
+    self.navigationController = navigationController
+  }
+
+  func showNewGroupController() {
+    let newGroupController = NewGroupViewController()
+    let coordinator = NewGroupCoordinator(navigationController: navigationController)
+    childCoordinators.append(coordinator)
+    newGroupController.coordinator = coordinator
+    navigationController.pushViewController(newGroupController, animated: true)
+  }
+
+  func showQRCodeController() {
+    let controller = QrCodeReaderController()
+    // controller.delegate = self
+    // present(controller, animated: true, completion: nil)
+  }
+
+  func showNewContactController() {
+    let newContactController = NewContactController()
+    navigationController.pushViewController(newContactController, animated: true)
+  }
+
+  func showNewChat(contactId: Int) {
+    let chatId = dc_create_chat_by_contact_id(mailboxPointer, UInt32(contactId))
+    showChat(chatId: Int(chatId))
+  }
+
+  func showChat(chatId: Int) {
+    let chatViewController = ChatViewController(chatId: chatId)
+    let coordinator = ChatViewCoordinator(navigationController: navigationController)
+    childCoordinators.append(coordinator)
+    chatViewController.coordinator = coordinator
+    navigationController.pushViewController(chatViewController, animated: true)
+    navigationController.viewControllers.remove(at: 1)
+  }
 }
 
 class ChatDetailCoordinator: Coordinator {
-	let navigationController: UINavigationController
+  let navigationController: UINavigationController
 
-	private var childCoordinators: [Coordinator] = []
+  private var childCoordinators: [Coordinator] = []
 
-	init(navigationController: UINavigationController) {
-		self.navigationController = navigationController
-	}
+  init(navigationController: UINavigationController) {
+    self.navigationController = navigationController
+  }
 }
 
 class ChatViewCoordinator: Coordinator {
-	let navigationController: UINavigationController
+  let navigationController: UINavigationController
 
-	var childCoordinators: [Coordinator] = []
+  var childCoordinators: [Coordinator] = []
 
-	init(navigationController: UINavigationController) {
-		self.navigationController = navigationController
-	}
+  init(navigationController: UINavigationController) {
+    self.navigationController = navigationController
+  }
 
-	func showChatDetail(chatId: Int) {
-		let chatDetailViewController = ChatDetailViewController(chatId: chatId)
-		let coordinator = ChatDetailCoordinator(navigationController: self.navigationController)
-		childCoordinators.append(coordinator)
-		chatDetailViewController.coordinator = coordinator
-		navigationController.pushViewController(chatDetailViewController, animated: true)
-	}
+  func showChatDetail(chatId: Int) {
+    let chatDetailViewController = ChatDetailViewController(chatId: chatId)
+    let coordinator = ChatDetailCoordinator(navigationController: navigationController)
+    childCoordinators.append(coordinator)
+    chatDetailViewController.coordinator = coordinator
+    navigationController.pushViewController(chatDetailViewController, animated: true)
+  }
 }
 
 class NewGroupCoordinator: Coordinator {
+  let navigationController: UINavigationController
 
-	let navigationController: UINavigationController
-
-	private var childCoordinators: [Coordinator] = []
+  private var childCoordinators: [Coordinator] = []
 
-	init(navigationController: UINavigationController) {
-		self.navigationController = navigationController
-	}
-
-	func showGroupNameController(contactIdsForGroup: Set<Int>) {
-		let groupNameController = GroupNameController(contactIdsForGroup: contactIdsForGroup)
-		let coordinator = GroupNameCoordinator(navigationController: navigationController)
-		childCoordinators.append(coordinator)
-		groupNameController.coordinator = coordinator
-		navigationController.pushViewController(groupNameController, animated: true)
-	}
+  init(navigationController: UINavigationController) {
+    self.navigationController = navigationController
+  }
 
+  func showGroupNameController(contactIdsForGroup: Set<Int>) {
+    let groupNameController = GroupNameController(contactIdsForGroup: contactIdsForGroup)
+    let coordinator = GroupNameCoordinator(navigationController: navigationController)
+    childCoordinators.append(coordinator)
+    groupNameController.coordinator = coordinator
+    navigationController.pushViewController(groupNameController, animated: true)
+  }
 }
 
-
 class GroupNameCoordinator: Coordinator {
-
-	let navigationController: UINavigationController
-
-	private var childCoordinators: [Coordinator] = []
-
-	init(navigationController: UINavigationController) {
-		self.navigationController = navigationController
-	}
-
-	func showGroupChat(chatId: Int) {
-		let chatViewController = ChatViewController(chatId: chatId)
-		let coordinator = ChatViewCoordinator(navigationController: navigationController)
-		childCoordinators.append(coordinator)
-		chatViewController.coordinator = coordinator
-		navigationController.popToRootViewController(animated: false)
-		navigationController.pushViewController(chatViewController, animated: true)
-	}
+  let navigationController: UINavigationController
+
+  private var childCoordinators: [Coordinator] = []
+
+  init(navigationController: UINavigationController) {
+    self.navigationController = navigationController
+  }
+
+  func showGroupChat(chatId: Int) {
+    let chatViewController = ChatViewController(chatId: chatId)
+    let coordinator = ChatViewCoordinator(navigationController: navigationController)
+    childCoordinators.append(coordinator)
+    chatViewController.coordinator = coordinator
+    navigationController.popToRootViewController(animated: false)
+    navigationController.pushViewController(chatViewController, animated: true)
+  }
 }

+ 3 - 3
deltachat-ios/DC/events.swift

@@ -6,8 +6,8 @@
 //  Copyright © 2018 Jonas Reinsch. All rights reserved.
 //
 
-import UserNotifications
 import UIKit
+import UserNotifications
 
 let dcNotificationChanged = Notification.Name(rawValue: "MrEventMsgsChanged")
 let dcNotificationStateChanged = Notification.Name(rawValue: "MrEventStateChanged")
@@ -92,8 +92,8 @@ public func callbackSwift(event: CInt, data1: CUnsignedLong, data2: CUnsignedLon
       if done {
         UserDefaults.standard.set(true, forKey: Constants.Keys.deltachatUserProvidedCredentialsKey)
         UserDefaults.standard.synchronize()
-				let appDelegate = UIApplication.shared.delegate as! AppDelegate
-				appDelegate.appCoordinator?.showTab(index: 3)
+        let appDelegate = UIApplication.shared.delegate as! AppDelegate
+        appDelegate.appCoordinator?.showTab(index: 3)
         AppDelegate.lastErrorDuringConfig = nil
       }
     }

+ 1 - 5
deltachat-ios/Helper/Constants.swift

@@ -20,11 +20,7 @@ struct Constants {
     static let deltachatImapEmailKey = "__DELTACHAT_IMAP_EMAIL_KEY__"
     static let deltachatImapPasswordKey = "__DELTACHAT_IMAP_PASSWORD_KEY__"
   }
-
-  // static let primaryColor = UIColor(red: 81 / 255, green: 73 / 255, blue: 255 / 255, alpha: 1)
-  // static let messagePrimaryColor = Constants.primaryColor.withAlphaComponent(0.5)
-  // static let messageSecondaryColor = UIColor(red: 245 / 255, green: 245 / 255, blue: 245 / 255, alpha: 1)
-
+	
   static let defaultShadow = UIImage(color: UIColor(hexString: "ff2b82"), size: CGSize(width: 1, height: 1))
   static let onlineShadow = UIImage(color: UIColor(hexString: "3ed67e"), size: CGSize(width: 1, height: 1))
 

+ 8 - 8
deltachat-ios/Helper/Protocols.swift

@@ -9,21 +9,21 @@
 import UIKit
 
 protocol Coordinator: class {
-	// var rootViewController: UIViewController { get }
-	// func start()
+  // var rootViewController: UIViewController { get }
+  // func start()
 }
 
 protocol QrCodeReaderDelegate: class {
-	func handleQrCode(_ code: String)
+  func handleQrCode(_ code: String)
 }
 
 protocol ContactListDelegate: class {
-	func accessGranted()
-	func accessDenied()
-	func deviceContactsImported()
+  func accessGranted()
+  func accessDenied()
+  func deviceContactsImported()
 }
 
 protocol ChatDisplayer: class {
-	func displayNewChat(contactId: Int)
-	func displayChatForId(chatId: Int)
+  func displayNewChat(contactId: Int)
+  func displayChatForId(chatId: Int)
 }

+ 6 - 7
deltachat-ios/Model/Location.swift

@@ -10,14 +10,13 @@ import CoreLocation
 import Foundation
 import MessageKit
 
-
 struct Location: LocationItem {
-	var location: CLLocation
+  var location: CLLocation
 
-	var size: CGSize
+  var size: CGSize
 
-	init(location: CLLocation, size: CGSize) {
-		self.location = location
-		self.size = size
-	}
+  init(location: CLLocation, size: CGSize) {
+    self.location = location
+    self.size = size
+  }
 }

+ 14 - 14
deltachat-ios/Model/Media.swift

@@ -11,22 +11,22 @@ import Foundation
 import MessageKit
 
 struct Media: MediaItem {
-	var url: URL?
+  var url: URL?
 
-	var image: UIImage?
+  var image: UIImage?
 
-	var placeholderImage: UIImage = UIImage(named: "ic_attach_file_36pt")!
+  var placeholderImage: UIImage = UIImage(named: "ic_attach_file_36pt")!
 
-	var size: CGSize {
-		if let image = image {
-			return image.size
-		} else {
-			return placeholderImage.size
-		}
-	}
+  var size: CGSize {
+    if let image = image {
+      return image.size
+    } else {
+      return placeholderImage.size
+    }
+  }
 
-	init(url: URL? = nil, image: UIImage? = nil) {
-		self.url = url
-		self.image = image
-	}
+  init(url: URL? = nil, image: UIImage? = nil) {
+    self.url = url
+    self.image = image
+  }
 }

+ 67 - 67
deltachat-ios/NewGroupMemberChoiceController.swift

@@ -9,82 +9,82 @@
 import UIKit
 
 /*
-class ViewController: UIViewController {
-  override func viewDidLoad() {
-    super.viewDidLoad()
+ 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
+   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
+   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)
+   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 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
+   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.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.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)
+   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
-  }
+   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
-    }
-  }
+ @objc func didPressDeleteButton() {
+   if view.backgroundColor == UIColor.red {
+     view.backgroundColor = UIColor.white
+   } else {
+     view.backgroundColor = UIColor.red
+   }
+ }
 
-  override func didReceiveMemoryWarning() {
-    super.didReceiveMemoryWarning()
-  }
-}
+ override func didReceiveMemoryWarning() {
+   super.didReceiveMemoryWarning()
+ }
+ }
 
-*/
+ */

+ 78 - 81
deltachat-ios/View/ContactCell.swift

@@ -9,44 +9,43 @@
 import UIKit
 
 class ContactCell: UITableViewCell {
-	private let initialsLabelSize: CGFloat = 54
-	private let imgSize: CGFloat = 25
-
-
-	let avatar: UIView = {
-		let avatar = UIView()
-		return avatar
-	}()
-
-	lazy var imgView: UIImageView = {
-		let imgView = UIImageView()
-		let img = UIImage(named: "approval")!.withRenderingMode(.alwaysTemplate)
-		imgView.isHidden = true
-		imgView.image = img
-		imgView.bounds = CGRect(
-			x: 0,
-			y: 0,
-			width: imgSize, height: imgSize
-		)
-		return imgView
-	}()
-
-	lazy var initialsLabel: UILabel = {
-		let initialsLabel = UILabel()
-		initialsLabel.textAlignment = NSTextAlignment.center
-		initialsLabel.textColor = UIColor.white
-		initialsLabel.font = UIFont.systemFont(ofSize: 22)
-		initialsLabel.backgroundColor = UIColor.green
-		let initialsLabelCornerRadius = (initialsLabelSize - 6) / 2
-		initialsLabel.layer.cornerRadius = initialsLabelCornerRadius
-		initialsLabel.clipsToBounds = true
-		return initialsLabel
-	}()
+  private let initialsLabelSize: CGFloat = 54
+  private let imgSize: CGFloat = 25
+
+  let avatar: UIView = {
+    let avatar = UIView()
+    return avatar
+  }()
+
+  lazy var imgView: UIImageView = {
+    let imgView = UIImageView()
+    let img = UIImage(named: "approval")!.withRenderingMode(.alwaysTemplate)
+    imgView.isHidden = true
+    imgView.image = img
+    imgView.bounds = CGRect(
+      x: 0,
+      y: 0,
+      width: imgSize, height: imgSize
+    )
+    return imgView
+  }()
+
+  lazy var initialsLabel: UILabel = {
+    let initialsLabel = UILabel()
+    initialsLabel.textAlignment = NSTextAlignment.center
+    initialsLabel.textColor = UIColor.white
+    initialsLabel.font = UIFont.systemFont(ofSize: 22)
+    initialsLabel.backgroundColor = UIColor.green
+    let initialsLabelCornerRadius = (initialsLabelSize - 6) / 2
+    initialsLabel.layer.cornerRadius = initialsLabelCornerRadius
+    initialsLabel.clipsToBounds = true
+    return initialsLabel
+  }()
 
   let nameLabel = UILabel()
-	let emailLabel = UILabel()
+  let emailLabel = UILabel()
 
-	var darkMode: Bool = false {
+  var darkMode: Bool = false {
     didSet {
       if darkMode {
         contentView.backgroundColor = UIColor.darkGray
@@ -58,64 +57,62 @@ class ContactCell: UITableViewCell {
 
   override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
     super.init(style: style, reuseIdentifier: reuseIdentifier)
-		setupSubviews()
-    }
-
-	private func setupSubviews() {
-		let margin: CGFloat = 15
-
-		initialsLabel.translatesAutoresizingMaskIntoConstraints = false
-		avatar.translatesAutoresizingMaskIntoConstraints = false
-		initialsLabel.widthAnchor.constraint(equalToConstant: initialsLabelSize - 6).isActive = true
-		initialsLabel.heightAnchor.constraint(equalToConstant: initialsLabelSize - 6).isActive = true
-		// avatar.backgroundColor = .red
+    setupSubviews()
+  }
 
-		avatar.widthAnchor.constraint(equalToConstant: initialsLabelSize).isActive = true
-		avatar.heightAnchor.constraint(equalToConstant: initialsLabelSize).isActive = true
+  private func setupSubviews() {
+    let margin: CGFloat = 15
 
-		avatar.addSubview(initialsLabel)
-		contentView.addSubview(avatar)
+    initialsLabel.translatesAutoresizingMaskIntoConstraints = false
+    avatar.translatesAutoresizingMaskIntoConstraints = false
+    initialsLabel.widthAnchor.constraint(equalToConstant: initialsLabelSize - 6).isActive = true
+    initialsLabel.heightAnchor.constraint(equalToConstant: initialsLabelSize - 6).isActive = true
+    // avatar.backgroundColor = .red
 
-		initialsLabel.topAnchor.constraint(equalTo: avatar.topAnchor, constant: 3).isActive = true
-		initialsLabel.leadingAnchor.constraint(equalTo: avatar.leadingAnchor, constant: 3).isActive = true
-		initialsLabel.trailingAnchor.constraint(equalTo: avatar.trailingAnchor, constant: -3).isActive = true
+    avatar.widthAnchor.constraint(equalToConstant: initialsLabelSize).isActive = true
+    avatar.heightAnchor.constraint(equalToConstant: initialsLabelSize).isActive = true
 
-		avatar.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: margin).isActive = true
-		avatar.center.y = contentView.center.y
-		avatar.center.x += initialsLabelSize / 2
-		avatar.topAnchor.constraint(equalTo: contentView.topAnchor, constant: margin).isActive = true
-		avatar.bottomAnchor.constraint(lessThanOrEqualTo: contentView.bottomAnchor, constant: -margin).isActive = true
-		initialsLabel.center = avatar.center
+    avatar.addSubview(initialsLabel)
+    contentView.addSubview(avatar)
 
-		let myStackView = UIStackView()
-		myStackView.translatesAutoresizingMaskIntoConstraints = false
-		myStackView.clipsToBounds = true
+    initialsLabel.topAnchor.constraint(equalTo: avatar.topAnchor, constant: 3).isActive = true
+    initialsLabel.leadingAnchor.constraint(equalTo: avatar.leadingAnchor, constant: 3).isActive = true
+    initialsLabel.trailingAnchor.constraint(equalTo: avatar.trailingAnchor, constant: -3).isActive = true
 
-		contentView.addSubview(myStackView)
-		myStackView.leadingAnchor.constraint(equalTo: avatar.trailingAnchor, constant: margin).isActive = true
-		myStackView.centerYAnchor.constraint(equalTo: avatar.centerYAnchor).isActive = true
-		myStackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -margin).isActive = true
-		myStackView.axis = .vertical
-		myStackView.addArrangedSubview(nameLabel)
-		myStackView.addArrangedSubview(emailLabel)
+    avatar.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: margin).isActive = true
+    avatar.center.y = contentView.center.y
+    avatar.center.x += initialsLabelSize / 2
+    avatar.topAnchor.constraint(equalTo: contentView.topAnchor, constant: margin).isActive = true
+    avatar.bottomAnchor.constraint(lessThanOrEqualTo: contentView.bottomAnchor, constant: -margin).isActive = true
+    initialsLabel.center = avatar.center
 
-		nameLabel.font = UIFont.systemFont(ofSize: 16, weight: .medium)
-		nameLabel.lineBreakMode = .byTruncatingTail
-		nameLabel.textColor = UIColor(hexString: "2f3944")
+    let myStackView = UIStackView()
+    myStackView.translatesAutoresizingMaskIntoConstraints = false
+    myStackView.clipsToBounds = true
 
-		emailLabel.font = UIFont.systemFont(ofSize: 14)
-		emailLabel.textColor = UIColor(hexString: "848ba7")
-		emailLabel.lineBreakMode = .byTruncatingTail
+    contentView.addSubview(myStackView)
+    myStackView.leadingAnchor.constraint(equalTo: avatar.trailingAnchor, constant: margin).isActive = true
+    myStackView.centerYAnchor.constraint(equalTo: avatar.centerYAnchor).isActive = true
+    myStackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -margin).isActive = true
+    myStackView.axis = .vertical
+    myStackView.addArrangedSubview(nameLabel)
+    myStackView.addArrangedSubview(emailLabel)
 
+    nameLabel.font = UIFont.systemFont(ofSize: 16, weight: .medium)
+    nameLabel.lineBreakMode = .byTruncatingTail
+    nameLabel.textColor = UIColor(hexString: "2f3944")
 
-		imgView.tintColor = DCColors.primary
+    emailLabel.font = UIFont.systemFont(ofSize: 14)
+    emailLabel.textColor = UIColor(hexString: "848ba7")
+    emailLabel.lineBreakMode = .byTruncatingTail
 
-		avatar.addSubview(imgView)
+    imgView.tintColor = DCColors.primary
 
-		imgView.center.x = avatar.center.x + (avatar.frame.width / 2) + imgSize - 5
-		imgView.center.y = avatar.center.y + (avatar.frame.height / 2) + imgSize - 5
+    avatar.addSubview(imgView)
 
-	}
+    imgView.center.x = avatar.center.x + (avatar.frame.width / 2) + imgSize - 5
+    imgView.center.y = avatar.center.y + (avatar.frame.height / 2) + imgSize - 5
+  }
 
   func setVerified(isVerified: Bool) {
     imgView.isHidden = !isVerified
@@ -136,7 +133,7 @@ class ContactCell: UITableViewCell {
     setColor(color)
   }
 
-	func setColor(_ color: UIColor) {
+  func setColor(_ color: UIColor) {
     initialsLabel.backgroundColor = color
   }
 

+ 43 - 46
deltachat-ios/View/GroupNameCell.swift

@@ -9,59 +9,56 @@
 import UIKit
 
 class GroupLabelCell: UITableViewCell {
+  private let groupBadgeSize: CGFloat = 60
+  var groupNameUpdated: ((String) -> Void)? // use this callback to update editButton in navigationController
 
-	private let groupBadgeSize: CGFloat = 60
-	var groupNameUpdated: ((String) -> Void)?	// use this callback to update editButton in navigationController
+  lazy var groupBadge: InitialsLabel = {
+    let badge = InitialsLabel(size: groupBadgeSize)
+    badge.set(color: UIColor.lightGray)
+    return badge
+  }()
 
-	lazy var groupBadge: InitialsLabel = {
-		let badge = InitialsLabel(size: groupBadgeSize)
-		badge.set(color: UIColor.lightGray)
-		return badge
-	}()
+  lazy var inputField: UITextField = {
+    let textField = UITextField()
+    textField.placeholder = "Group Name"
+    textField.borderStyle = .none
+    textField.becomeFirstResponder()
+    textField.autocorrectionType = .no
+    textField.addTarget(self, action: #selector(nameFieldChanged), for: .editingChanged)
+    return textField
+  }()
 
-	lazy var inputField: UITextField = {
-		let textField = UITextField()
-		textField.placeholder = "Group Name"
-		textField.borderStyle = .none
-		textField.becomeFirstResponder()
-		textField.autocorrectionType = .no
-		textField.addTarget(self, action: #selector(nameFieldChanged), for: .editingChanged)
-		return textField
-	}()
+  override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+    super.init(style: style, reuseIdentifier: reuseIdentifier)
+    setupSubviews()
+  }
 
-	override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-		super.init(style: style, reuseIdentifier: reuseIdentifier)
-		setupSubviews()
-	}
+  required init?(coder _: NSCoder) {
+    fatalError("init(coder:) has not been implemented")
+  }
 
-	required init?(coder aDecoder: NSCoder) {
-		fatalError("init(coder:) has not been implemented")
-	}
+  private func setupSubviews() {
+    contentView.addSubview(groupBadge)
+    groupBadge.translatesAutoresizingMaskIntoConstraints = false
 
-	private func setupSubviews() {
+    groupBadge.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor, constant: 0).isActive = true
+    groupBadge.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor, constant: 5).isActive = true
+    groupBadge.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor, constant: -5).isActive = true
+    groupBadge.widthAnchor.constraint(equalToConstant: groupBadgeSize).isActive = true
+    groupBadge.heightAnchor.constraint(equalToConstant: groupBadgeSize).isActive = true
 
-		contentView.addSubview(groupBadge)
-		groupBadge.translatesAutoresizingMaskIntoConstraints = false
+    contentView.addSubview(inputField)
+    inputField.translatesAutoresizingMaskIntoConstraints = false
 
-		groupBadge.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor, constant: 0).isActive = true
-		groupBadge.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor, constant: 5).isActive = true
-		groupBadge.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor, constant: -5).isActive = true
-		groupBadge.widthAnchor.constraint(equalToConstant: groupBadgeSize).isActive = true
-		groupBadge.heightAnchor.constraint(equalToConstant: groupBadgeSize).isActive = true
+    inputField.leadingAnchor.constraint(equalTo: groupBadge.trailingAnchor, constant: 15).isActive = true
+    inputField.heightAnchor.constraint(equalToConstant: 45).isActive = true
+    inputField.centerYAnchor.constraint(equalTo: groupBadge.centerYAnchor, constant: 0).isActive = true
+    inputField.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor, constant: 0).isActive = true
+  }
 
-		contentView.addSubview(inputField)
-		inputField.translatesAutoresizingMaskIntoConstraints = false
-
-		inputField.leadingAnchor.constraint(equalTo: groupBadge.trailingAnchor, constant: 15).isActive = true
-		inputField.heightAnchor.constraint(equalToConstant: 45).isActive = true
-		inputField.centerYAnchor.constraint(equalTo: groupBadge.centerYAnchor, constant: 0).isActive = true
-		inputField.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor, constant: 0).isActive = true
-	}
-
-	@objc func nameFieldChanged() {
-		let groupName = inputField.text ?? ""
-		groupBadge.set(name: groupName)
-		groupNameUpdated?(groupName)
-	}
+  @objc func nameFieldChanged() {
+    let groupName = inputField.text ?? ""
+    groupBadge.set(name: groupName)
+    groupNameUpdated?(groupName)
+  }
 }
-

+ 23 - 24
deltachat-ios/View/InitialsLabel.swift

@@ -9,32 +9,31 @@
 import UIKit
 
 class InitialsLabel: UILabel {
+  convenience init(name: String, color: UIColor, size: CGFloat) {
+    self.init(size: size)
+    set(name: name)
+    set(color: color)
+  }
 
-	convenience init(name: String, color: UIColor, size: CGFloat) {
-		self.init(size: size)
-		set(name: name)
-		set(color: color)
-	}
+  init(size: CGFloat) {
+    super.init(frame: CGRect(x: 0, y: 0, width: size, height: size))
+    textAlignment = NSTextAlignment.center
+    textColor = UIColor.white
+    adjustsFontSizeToFitWidth = true
+    let initialsLabelCornerRadius = size / 2
+    layer.cornerRadius = initialsLabelCornerRadius
+    clipsToBounds = true
+  }
 
-	init(size: CGFloat) {
-		super.init(frame: CGRect(x: 0, y: 0, width: size, height: size))
-		textAlignment = NSTextAlignment.center
-		textColor = UIColor.white
-		adjustsFontSizeToFitWidth = true
-		let initialsLabelCornerRadius = size / 2
-		layer.cornerRadius = initialsLabelCornerRadius
-		clipsToBounds = true
-	}
+  required init?(coder _: NSCoder) {
+    fatalError("init(coder:) has not been implemented")
+  }
 
-	required init?(coder aDecoder: NSCoder) {
-		fatalError("init(coder:) has not been implemented")
-	}
+  func set(name: String) {
+    text = Utils.getInitials(inputName: name)
+  }
 
-	func set(name: String) {
-		self.text = Utils.getInitials(inputName: name)
-	}
-
-	func set(color: UIColor) {
-		backgroundColor = color
-	}
+  func set(color: UIColor) {
+    backgroundColor = color
+  }
 }