mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Add a UIRefreshControl to be the indicator of load more function.
This commit is contained in:
@@ -34,6 +34,10 @@ open class MessagesViewController: UIViewController {
|
||||
/// The `MessageInputBar` used as the `inputAccessoryView` in the view controller.
|
||||
open var messageInputBar = MessageInputBar()
|
||||
|
||||
open var messageLoadMoreControl: UIRefreshControl {
|
||||
return messagesCollectionView.messageLoadMoreControl
|
||||
}
|
||||
|
||||
/// A Boolean value that determines whether the `MessagesCollectionView` scrolls to the
|
||||
/// bottom on the view's first layout.
|
||||
///
|
||||
|
||||
@@ -35,6 +35,8 @@ open class MessagesCollectionView: UICollectionView {
|
||||
open weak var messagesLayoutDelegate: MessagesLayoutDelegate?
|
||||
|
||||
open weak var messageCellDelegate: MessageCellDelegate?
|
||||
|
||||
open var messageLoadMoreControl = UIRefreshControl()
|
||||
|
||||
open var showsDateHeaderAfterTimeInterval: TimeInterval = 3600
|
||||
|
||||
@@ -51,6 +53,7 @@ open class MessagesCollectionView: UICollectionView {
|
||||
public override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) {
|
||||
super.init(frame: frame, collectionViewLayout: layout)
|
||||
backgroundColor = .white
|
||||
addSubview(messageLoadMoreControl)
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
|
||||
Reference in New Issue
Block a user