diff --git a/deltachat-ios/Chat/ChatViewController.swift b/deltachat-ios/Chat/ChatViewController.swift index 6c27c61c5..70ae4370e 100644 --- a/deltachat-ios/Chat/ChatViewController.swift +++ b/deltachat-ios/Chat/ChatViewController.swift @@ -114,7 +114,7 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate { private lazy var muteItem: UIBarButtonItem = { let imageView = UIImageView() imageView.tintColor = DcColors.defaultTextColor - imageView.image = #imageLiteral(resourceName: "volume_off").withRenderingMode(.alwaysTemplate) + imageView.image = UIImage(named: "volume_off")?.withRenderingMode(.alwaysTemplate) imageView.translatesAutoresizingMaskIntoConstraints = false imageView.heightAnchor.constraint(equalToConstant: 20).isActive = true imageView.widthAnchor.constraint(equalToConstant: 20).isActive = true @@ -124,7 +124,7 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate { private lazy var ephemeralMessageItem: UIBarButtonItem = { let imageView = UIImageView() imageView.tintColor = DcColors.defaultTextColor - imageView.image = #imageLiteral(resourceName: "ephemeral_timer").withRenderingMode(.alwaysTemplate) + imageView.image = UIImage(named: "ephemeral_timer")?.withRenderingMode(.alwaysTemplate) imageView.translatesAutoresizingMaskIntoConstraints = false imageView.heightAnchor.constraint(equalToConstant: 20).isActive = true imageView.widthAnchor.constraint(equalToConstant: 20).isActive = true @@ -1230,7 +1230,7 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate { InputBarButtonItem() .configure { $0.spacing = .fixed(0) - let clipperIcon = #imageLiteral(resourceName: "ic_attach_file_36pt").withRenderingMode(.alwaysTemplate) + let clipperIcon = UIImage(named: "ic_attach_file_36pt")?.withRenderingMode(.alwaysTemplate) $0.image = clipperIcon $0.tintColor = DcColors.primary $0.setSize(CGSize(width: 40, height: 40), animated: false) diff --git a/deltachat-ios/Chat/Views/Cells/VideoInviteCell.swift b/deltachat-ios/Chat/Views/Cells/VideoInviteCell.swift index 9f45c0d75..8b6b8d5b4 100644 --- a/deltachat-ios/Chat/Views/Cells/VideoInviteCell.swift +++ b/deltachat-ios/Chat/Views/Cells/VideoInviteCell.swift @@ -28,7 +28,7 @@ public class VideoInviteCell: UITableViewCell { view.setColor(DcColors.systemMessageBackgroundColor) view.translatesAutoresizingMaskIntoConstraints = false view.setContentHuggingPriority(.defaultHigh, for: .horizontal) - view.setImage(#imageLiteral(resourceName: "ic_videochat").withRenderingMode(.alwaysTemplate)) + view.setImage(UIImage(named: "ic_videochat")?.withRenderingMode(.alwaysTemplate)) view.tintColor = .white view.imagePadding = 3 return view diff --git a/deltachat-ios/Chat/Views/DraftPreview.swift b/deltachat-ios/Chat/Views/DraftPreview.swift index 7bc6084c0..597ab08e1 100644 --- a/deltachat-ios/Chat/Views/DraftPreview.swift +++ b/deltachat-ios/Chat/Views/DraftPreview.swift @@ -22,7 +22,7 @@ public class DraftPreview: UIView { private lazy var cancelImageView: UIImageView = { let view = UIImageView(image: UIImage()) view.tintColor = .systemBlue - view.image = #imageLiteral(resourceName: "ic_close_36pt").withRenderingMode(.alwaysTemplate) + view.image = UIImage(named: "ic_close_36pt")?.withRenderingMode(.alwaysTemplate) view.translatesAutoresizingMaskIntoConstraints = false return view }() diff --git a/deltachat-ios/Chat/Views/StatusView.swift b/deltachat-ios/Chat/Views/StatusView.swift index 459f18f74..ee6a30fc1 100644 --- a/deltachat-ios/Chat/Views/StatusView.swift +++ b/deltachat-ios/Chat/Views/StatusView.swift @@ -96,13 +96,13 @@ public class StatusView: UIView { switch Int32(state) { case DC_DOWNLOAD_IN_PROGRESS, DC_STATE_OUT_PENDING, DC_STATE_OUT_PREPARING: - stateView.image = #imageLiteral(resourceName: "ic_hourglass_empty_white_36pt").maskWithColor(color: tintColor) + stateView.image = UIImage(named: "ic_hourglass_empty_white_36pt")?.maskWithColor(color: tintColor) case DC_STATE_OUT_DELIVERED: - stateView.image = #imageLiteral(resourceName: "ic_done_36pt").maskWithColor(color: tintColor) + stateView.image = UIImage(named: "ic_done_36pt")?.maskWithColor(color: tintColor) case DC_STATE_OUT_MDN_RCVD: - stateView.image = #imageLiteral(resourceName: "ic_done_all_36pt").maskWithColor(color: tintColor) + stateView.image = UIImage(named: "ic_done_all_36pt")?.maskWithColor(color: tintColor) case DC_STATE_OUT_FAILED: - stateView.image = #imageLiteral(resourceName: "ic_error_36pt") + stateView.image = UIImage(named: "ic_error_36pt") default: stateView.image = nil } diff --git a/deltachat-ios/View/ContactCell.swift b/deltachat-ios/View/ContactCell.swift index 19d736b3a..ae145fd47 100644 --- a/deltachat-ios/View/ContactCell.swift +++ b/deltachat-ios/View/ContactCell.swift @@ -89,7 +89,7 @@ class ContactCell: UITableViewCell { view.translatesAutoresizingMaskIntoConstraints = false view.widthAnchor.constraint(equalToConstant: 16).isActive = true view.tintColor = DcColors.middleGray - view.image = #imageLiteral(resourceName: "pinned_chatlist").withRenderingMode(.alwaysTemplate) + view.image = UIImage(named: "pinned_chatlist")?.withRenderingMode(.alwaysTemplate) view.isHidden = true view.contentMode = .scaleAspectFit view.isAccessibilityElement = false @@ -101,7 +101,7 @@ class ContactCell: UITableViewCell { view.translatesAutoresizingMaskIntoConstraints = false view.widthAnchor.constraint(equalToConstant: 16).isActive = true view.tintColor = DcColors.middleGray - view.image = #imageLiteral(resourceName: "volume_off").withRenderingMode(.alwaysTemplate) + view.image = UIImage(named: "volume_off")?.withRenderingMode(.alwaysTemplate) view.isHidden = true view.contentMode = .scaleAspectFit view.isAccessibilityElement = false @@ -309,13 +309,13 @@ class ContactCell: UITableViewCell { } else { switch Int32(status) { case DC_STATE_OUT_PENDING, DC_STATE_OUT_PREPARING: - deliveryStatusIndicator.image = #imageLiteral(resourceName: "ic_hourglass_empty_white_36pt").maskWithColor(color: DcColors.middleGray) + deliveryStatusIndicator.image = UIImage(named: "ic_hourglass_empty_white_36pt")?.maskWithColor(color: DcColors.middleGray) case DC_STATE_OUT_DELIVERED: - deliveryStatusIndicator.image = #imageLiteral(resourceName: "ic_done_36pt") + deliveryStatusIndicator.image = UIImage(named: "ic_done_36pt") case DC_STATE_OUT_FAILED: - deliveryStatusIndicator.image = #imageLiteral(resourceName: "ic_error_36pt") + deliveryStatusIndicator.image = UIImage(named: "ic_error_36pt") case DC_STATE_OUT_MDN_RCVD: - deliveryStatusIndicator.image = #imageLiteral(resourceName: "ic_done_all_36pt") + deliveryStatusIndicator.image = UIImage(named: "ic_done_all_36pt") default: deliveryStatusIndicator.image = nil } diff --git a/deltachat-ios/View/InitialsBadge.swift b/deltachat-ios/View/InitialsBadge.swift index 08ad3e3af..e4fcabdce 100644 --- a/deltachat-ios/View/InitialsBadge.swift +++ b/deltachat-ios/View/InitialsBadge.swift @@ -116,7 +116,7 @@ public class InitialsBadge: UIView { label.font = font } - public func setImage(_ image: UIImage) { + public func setImage(_ image: UIImage?) { self.imageView.image = image self.imageView.contentMode = UIView.ContentMode.scaleAspectFill self.imageView.isHidden = false diff --git a/deltachat-ios/View/LocationStreamingIndicator.swift b/deltachat-ios/View/LocationStreamingIndicator.swift index f49f787cb..c83ee16a8 100644 --- a/deltachat-ios/View/LocationStreamingIndicator.swift +++ b/deltachat-ios/View/LocationStreamingIndicator.swift @@ -26,7 +26,7 @@ class LocationStreamingIndicator: UIImageView { private func setup(size: CGFloat) { tintColor = DcColors.checkmarkGreen - image = #imageLiteral(resourceName: "ic_location").withRenderingMode(.alwaysTemplate) + image = UIImage(named: "ic_location")?.withRenderingMode(.alwaysTemplate) translatesAutoresizingMaskIntoConstraints = false constraintHeightTo(size, priority: .defaultLow).isActive = true constraintWidthTo(aspectRatio * size).isActive = true