Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add sent time in every chat message? #373

Open
Gopal06bca opened this issue Oct 11, 2017 · 4 comments
Open

How to add sent time in every chat message? #373

Gopal06bca opened this issue Oct 11, 2017 · 4 comments

Comments

@Gopal06bca
Copy link

I need to show sent time in each and every message like whatsapp..

@saroar
Copy link

saroar commented Oct 11, 2017

hold your msg and swap left you can see time if you already add it :) ur code
something like this

        
        let item = TextChatInputItem()
        item.textInputHandler = { text in
            
            let date = Date()
            let double = Double(date.timeIntervalSinceReferenceDate)
            let senderID = "me"
            
            let message = MessageModel(uid: "\(double, senderID)", senderId: senderID, type: ChatTextModel.chatItemType, isIncoming: false, date: Date(), status: .success)
            let textMessage = ChatTextModel(messageModel: message, text: text)
            self.dataSource.addMessage(message: textMessage)
        }
        
        return item
    
    }

see the Date()

@Gopal06bca
Copy link
Author

Thanks for your reply..

@jensonjohn001
Copy link

How to disable swipe action? I don't need to show the time view.

@Denismih
Copy link

How to disable swipe action? I don't need to show the time view.

Set self.accessoryViewRevealerIsEnabled = false in ChatViewController

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants