Add a UIRefreshControl to be the indicator of load more function.

This commit is contained in:
azurechen
2017-10-26 01:15:30 +08:00
parent acda182df8
commit 74b90dd637
2 changed files with 7 additions and 0 deletions
@@ -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) {