Author Topic: iOS8 style delete UX functionality  (Read 2510 times)

PauliusLiekis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
iOS8 style delete UX functionality
« on: May 17, 2016, 03:54:05 AM »
Hi,

I need to build iOS8 style delete UX functionality. I mean the one where you slide it sideways and a delete button appears.


It also supposed to work if content is in a scrollview.

I though I would try building it using a ScrollView and UISlider (for delete). It kinda could work. One main difference from iOS UX is that it works only on vertical and horizontal axis exclusively, i.e. it slides on one or on another. NGUI just slides on both.

Is there a way to build it in a better way? Maybe there are some dedicated components for that?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: iOS8 style delete UX functionality
« Reply #1 on: May 18, 2016, 05:05:57 AM »
2 scroll views, one inside the other. One scrollable horizontally, another vertically. You'll need two UIDragScrollView components on each object inside to reference both scroll views. Make sure to limit the scroll views -- one horizontally, the other vertically.

PauliusLiekis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: iOS8 style delete UX functionality
« Reply #2 on: May 18, 2016, 05:28:52 AM »
Correct me if I'm wrong, but it sounds like it would scroll on both at the same time, i.e. if I would move my finger diagonally it would scroll the list and show Delete button partially for the item that I'm touching. That's the behaviour that I'm trying to avoid, i.e. if you do it on iOS8/iOS9 apps it either scrolls horizontally (i.e. you can open Delete button) or scrolls vertically (scrolls the list), i.e. they scrolls directions are mutually exclusive.

And it's not just about delete functionality - there are a bunch of 2 directional scroll views in iOS that work in this mutually exclusive way - you either scroll in one direction or the other, but not in both at the same time.

So I was wondering if there is a native support for that in NGUI?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: iOS8 style delete UX functionality
« Reply #3 on: May 18, 2016, 05:42:20 AM »
No, it won't. Check the drag & drop example that comes with NGUI. You can scroll vertically, or drag items off of the scroll view horizontally. Whichever action is taken depends on which way the touch is moving when the threshold is passed.