UISlider in Today View Extension (Widget)
Asked Answered
P

2

6

I'm having troubles using a UISlider in an iOS8 Today Extension. When you start sliding the slider to the right, everything works fine. You can keep on sliding from left to right and the other way around.

However, if you start sliding to the left, the Notification Center will scroll/slide away from the 'Today' view into the 'Notifications' view.

Who can help me figure out, how to disable this behavior?

Pacifier answered 2/10, 2014 at 19:53 Comment(1)
Oy. I believe Apple's advice on avoiding scroll views also applies to sliders. See this answer. You're probably out of luck because you would need to change the behavior or the swipe gesture recognizer and you are heavily sandboxed.Embezzle
E
4

Apple doesn't recommend to use slider and scroll view in widget section because there are already a swipe gesture by default (on swiping right,user moves to notification section).So replace you slider with buttons.

Engineering answered 28/10, 2014 at 4:55 Comment(0)
A
1

The use of sliders and scrollviews in a today widget cause conflict on touch with built in touch gesture recognizers that apple has built into the today view.

The solution to this (as we implemented in our app) was to create a button that could be tapped and then the image of this button would change to show current state.

Appel answered 10/10, 2014 at 18:16 Comment(2)
You probably mean that you've "replaced" a UISwitch with a state-button? Button with '+' and '-' signs are my last resort...Pacifier
Actually we load a tableview (limited to 3 rows) and have an image (that looks like a button) in each row. On didSelectRow we change the state of a variable and adjust the image to reflect that current state.Appel

© 2022 - 2024 — McMap. All rights reserved.