This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setupUI() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func setupUI() { | |
view.addSubview(cameraButton) | |
cameraButton.translatesAutoresizingMaskIntoConstraints = false | |
cameraButton.setImage(UIImage(systemName: "camera.fill", | |
withConfiguration: UIImage.SymbolConfiguration(font: .systemFont(ofSize: 24))), | |
for: .normal) | |
cameraButton.tintColor = UIColor.gray.withAlphaComponent(0.7) | |
view.addSubview(soundRecordButton) | |
soundRecordButton.translatesAutoresizingMaskIntoConstraints = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private let cameraButton = UIButton() | |
private let soundRecordButton = UIButton() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func createChatViewController(with channelPresenter: ChannelPresenter) -> ChatViewController { | |
MessagesViewController(nibName: nil, bundle: nil) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import StreamChat | |
import RxSwift | |
class MessagesViewController: ChatViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
navigationItem.largeTitleDisplayMode = .never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
style.incomingMessage.avatarViewStyle = nil | |
style.incomingMessage.backgroundColor = UIColor(red: 233/255, green: 233/255, blue: 235/255, alpha: 1) | |
style.incomingMessage.borderColor = .clear | |
style.incomingMessage.textColor = .black | |
style.incomingMessage.font = .systemFont(ofSize: 17, weight: .regular) | |
style.incomingMessage.edgeInsets.left = 16 | |
style.incomingMessage.infoFont = .systemFont(ofSize: 0) | |
style.incomingMessage.nameFont = .systemFont(ofSize: 0) | |
style.outgoingMessage.avatarViewStyle = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tableView.register(ContactListCell.self, forCellReuseIdentifier: ContactListCell.reuseIdentifier) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func updateChannelCell(_ cell: ChannelTableViewCell, channelPresenter: ChannelPresenter) { | |
super.updateChannelCell(cell, channelPresenter: channelPresenter) | |
if let cell = cell as? ContactListCell { | |
cell.isUnread = channelPresenter.isUnread | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import StreamChat | |
class ContactListCell: ChannelTableViewCell { | |
static var reuseIdentifier: String { | |
return String(describing: self) | |
} | |
private let unreadView = UIView() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
presenter = ChannelsPresenter(filter: .currentUserInMembers) | |
title = "Messages" | |
setupStyles() | |
tableView.tableFooterView = nil | |
navigationItem.largeTitleDisplayMode = .always | |
NewerOlder