Skip to content

Add copy menu for long press gesture on message bubbles #143

Closed

Description

@SD10

Since we're not using UITextView for the message label, the text is not selectable.
We should add support for copying the text of the MessageLabels.

Activity

  1. etoledom commented on Sep 22, 2017

    @etoledom
    Contributor

    I'm interested in this one.
    Should I take it from the 0.8.0 branch?
    Is there any particular reason we are not using UITextView?
    What kind of UI do you have in mind? It would be cool maybe something fancy like Telegram and WhatsApp, but Messages shows a simple action sheet as the copy control 😂

  2. SD10 commented on Sep 22, 2017

    @SD10
    MemberAuthor

    Hey @etoledom, I'm working on trying to finish up v0.8.0 now so this is probably better for v0.9.0+
    I know @Ganzolo expressed interest in this and may have started working on it.

    We're not using UITextView because I was advised not to -- which is good enough for me :)

    As for the UI, I'm thinking something like the old iMessage/JSQMVC style. Although, the greater flexibility we can provide the better 😃

  3. etoledom commented on Sep 22, 2017

    @etoledom
    Contributor

    Cool! Let’s hope @Ganzolo can tell us if he is in this 😅.
    #145 is interesting for me too, I have been working a lot with maps lately.

  4. hamzaozturk commented on Sep 22, 2017

    @hamzaozturk
    Member

    In JSQMVC, uitextview was being used. The main problem was that, when you use the UIMenuController, there was a conflict between the collection view's UIMenuController and textview's. When you want to allow data detectors, you need to set uitextview selectable. Once you set it as selectable, then it would allow data detectors, then there will be a conflict with the collection view's UIMenuController. Therefore, we couldn't have used data detectors in JSQMVC.

    I think we can use the collection view's UIMenuController to copy the texts. These way we can easily copy both texts and media messages.

  5. SD10 commented on Sep 22, 2017

    @SD10
    MemberAuthor

    Awesome @hamzaozturk thanks for this clear explanation and the valuable insight ❤️

  6. Ganzolo commented on Sep 22, 2017

    @Ganzolo

    Yes, I started working on it, I am going to PR something very soon, within next couple of days.

  7. Ganzolo commented on Sep 22, 2017

    @Ganzolo

    Just sharing some progress here. I am using following set of requirements for implementing copy :

    • Copy Menu should be centered above message container (a.k.a bubbles)
    • Message container should be the only clickable zone to display menu. Meaning clicking on white background of a message cell should not trigger this menu
    • Color of message should be slightly highlighted to reflect selection
    • Whole MessageCollectionView's scrollview should stop allowing scrolling when having menu displayed. In my tests, this prevents Copy message to be misaligned when scrolling (and also this is default behavior of most other tasks, Messages and Viber for instance).

    So far the only lines I had to deactivate to start working on this feature is Long press gesture on MessageLabel.swift @SD10 would tell if it's acceptable.

  8. SD10 commented on Sep 22, 2017

    @SD10
    MemberAuthor

    @Ganzolo Yes the long press gesture for MessageLabel should be used for this. Those sound like good requirements to me.

  9. SD10 commented on Jan 11, 2018

    @SD10
    MemberAuthor

    This is resolved by #422 in MessageKit 13.0

  10. added this to the 0.13.0 milestone on Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions