ListView - LongPress and UIMenuController

5 posts, 0 answers
  1. DEZOOMER Josian
    DEZOOMER Josian avatar
    5 posts
    Member since:
    May 2010

    Posted 13 Jun Link to this post

    Hi,

    I have 2 questions about TKListView :

    1 - Is it possible to keep both behaviours LongPress and Press on a listView cell ?

    I want a "normal" action on Press and a "Special' action on the long press (which will be described in point 2)

     

    2 - So the action i want on long press is displaying a custom context menu (UIMenuController) with my own set of actions.

     

    Can TKListView answer YES and if so, HOW to my questions ?

     

    Regards,

  2. DEZOOMER Josian
    DEZOOMER Josian avatar
    5 posts
    Member since:
    May 2010

    Posted 15 Jun in reply to DEZOOMER Josian Link to this post

    Hi,

    Is there a follow-up on this forum ?

    Best Regards,

  3. DevCraft banner
  4. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 15 Jun Link to this post

    Hello Josian,

    As the documentation states, there are two callbacks that can be used in this scenario:

    http://docs.telerik.com/devtools/ios/api/Protocols/TKListViewDelegate.html

    – listView:didLongPressCell:atIndexPath:
    – listView:didSelectItemAtIndexPath:

    Do they not work for you?

    Regards,
    Deyan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. DEZOOMER Josian
    DEZOOMER Josian avatar
    5 posts
    Member since:
    May 2010

    Posted 15 Jun in reply to Deyan Link to this post

    thank you for your answer....

     

    I read and tried this scenario but the problem is the  TKListViewSelectionBehavior  has only 3 options :

    - None,
    - Press => fires the – listView:didSelectItemAtIndexPath:
    - LongPress => fires the – listView:didLongPressCell:atIndexPath: and then the – listView:didSelectItemAtIndexPath:

    I can't choose to keep both Press AND LongPress action...

     

    What i need is : Being able to set the TKListViewSelectionBehavior to Press AND LongPress with this behavior :

    - Press : fires the – listView:didSelectItemAtIndexPath:

    - LongPress => fires the – listView:didLongPressCell:atIndexPath:

     

    Regards,

     

     

  6. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 17 Jun Link to this post

    Hi Josian,

    Thanks. I now have better understanding of the scenario.

    In your case my suggestion would be to use the Press selection mode and additionally implement the LongPress functionality by following the instructions in this post on StackOverflow:

    http://stackoverflow.com/questions/18848725/long-press-gesture-on-uicollectionviewcell


    Regards,

    Deyan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

     
Back to Top
DevCraft banner