当我调用它的委托和数据源时,我正在使用 MessageKit 进行聊天(在范围内找不到'messagesCollectionView')请查看代码并指导我,谢谢。
import UIKit
import FirebaseAuth
import MessageKit
struct Message: MessageType{
var sender: SenderType
var messageId: String
var sentDate: Date
var kind: MessageKind
}
struct sender: SenderType{
var photo: String
var senderId: String
var displayName: String
}
class ChatDashboard: UIViewController {
@IBOutlet weak var lblUser: UILabel!
var userActive: String? = nil
override func viewDidLoad() {
super.viewDidLoad()
messagesCollectionView.messagesDataSource = self
messagesCollectionView.messagesLayoutDelegate = self
messagesCollectionView.messagesDisplayDelegate = self //not working delegate and datasource
if let userData = userActive{
self.lblUser.text = userData
}
}
override func viewDidAppear(_ animated: Bool) {
}
}