how to implement drag and drop like shortcuts which developed by apple? - ios

I know how to enable drag and drop for tableview in iOS. But the default behavior of it looks strange. User must press a cell for a long time to enable drag. I have read some answers said that changed the minimumPressDuration to 0.1. I had tried this way, but I don't think it's good enough.
What I want likes shortcuts app showed which is simulously.

Related

iOS accessibility: what are the pros/cons for hardcoding "double tap to activate" as hint?

iOS has built-in support for accessibility, for UIButtons it reads the title of the button followed by a hint "double tap to activate" (by default). Sometimes we are required to make a non-UIButton control behaving similar to UIButton in terms of accessibility, so we would set its accessibility trait to button and hardcode "double tap to activate" for accessibilityHint.
I don't like altering system behaviours, and I've seen accessibility users who prefer single tap instead of double tap (there's an option they can set), although I haven't checked if the opt for single tap instead of double tap, does the system hint become "single tap to activiate".
What is the common practice regarding accessibility support for a non-UIButton control that is tappable? Thanks!
I've seen accessibility users who prefer single tap instead of double tap (there's an option they can set)
I'm really curious to know how it's possible using VoiceOver because a single tap with one finger deals with the accessibility focus. In the UIButton documentation, Apple states: 🤓
VoiceOver speaks the value of the title [...] when a user taps the button once.
Would you mind detailing the way to activate this option you mentioned because I'm really astonished, please? 🤔
What is the common practice regarding accessibility support for a non-UIButton control that is tappable?
Using a hint is a very good practice to provide useful information to the user but this information mustn't be crucial for using because the accessibility hint may be deactivated in the device settings.😰
Admittedly speaking, this kind of element must be read out in such a way that its goal and its using are clear enough for any user: that's what traits are made for. 👍
Many traits are well known and give rise to different actions like adjustable values, customed actions and the rotor items using.
Besides, it's also possible to use the accessibilityActivate() method so as to define the purpose of a double-tap with one finger of an accessible element. 🤯
The way you want to vocally expose the possible actions on a tappable control depends on the content of your application.
Finally, keep in mind that hardcoding a hint must be understood as a plus information but definitely not as an essential one because it can be deactivated by the user: a conception oriented a11y is very important when building an app. 😉

How create popup button in xcode?

I want to create a custom keyboard, and I want to add more characters on it. if user long press a button it show more characters. like IOS default keyboard shows popup button after long press.
I created a very complex keyboard a few months ago where every key needed to have at least 5 different variations (Amharic dialect). I found that many pop ups do not work very well as they don't pop up over the top of the keyboard, I looked at how other keyboards achieved this but couldn't find a way to make it work. You can see a question on this problem here.
As a work around I created my custom keyboard with an extra row on the top, this was normally filled with numbers but on a long press would switch to show the alternative keys available. On long press the key pressed would be added to the field and if they chose on of the alternatives it would then replace the first key.
To give you a better idea here are some images:
Regular Keyboard:
Long press:
NOTE: Excuse the poor quality but I could only find an intermediate version of the project to screen print.
While working on this project I found that pop ups were a lot more difficult to achieve than this. I researched creating my own pop ups with bezier paths and also using pop ups themselves with the CYRKeyboard Button. (Note although the CYR gif shows the exact functionality required I found this gif to be extremely misleading). But in the end I came back to the above solution which worked very smoothly, quickly and easily.
Hope this helps

Making dynamically updating content in a UITableView accessible for VoiceOver

I'm trying to make my app more accessible and so far the standard accessibility things like labels and hints are doing wonders. I'm hitting a problem however with dynamically updating content that's displayed in a UITableView.
Each row of the table updates every second or so, but if I try to create each cell's accessibilityLabel at this point then I find that there is a problem with the VoiceOver reading out the selected label keeps interrupting itself as the label contents changes so the system just starts reading the label content from the beginning again (actually an odd quirk shows the voice over sometimes works correctly for the first cell that was selected, but upon selecting a new cell this bug returns).
I've tried to see if there's anyway to try and understand whether VoiceOver is currently active but as far as I can see there is only a notification posted when VoiceOver finishes
UIAccessibilityAnnouncementDidFinishNotification
There's no equivalent notification for when VoiceOver begins. So there's no way for my TableViewController to know that VoiceOver is currently active and that it shouldn't update any accessibilityLabels.
I'd hoped I could at least detect that one of my TableView cells was the selected accessibilityElement using the
accessibilityElementIsFocused
method. However in all my testing I've not been able to see this reliably fire for a custom UITableViewCell.
I also tried implementing the getter for accessibilityLabel for my custom cell hoping this may work, but sadly the same behaviour occurs.
The only solution I'm left with is a user configurable frequency for dynamic content accessibility updates, say 5, 10, 20 seconds... which can block me updating my label until I know that the last changed content would have definitely been read out. Actually even this could be interrupted if the user chose to select a cell at say 8 seconds after the last update, 2 seconds in for a 10 second limit and the label would update causing the voice over to restart.
Has anyone any ideas of how best to handle this dynamic updating content? I'm presuming the tableview cells are complicating matters a little, but in general I just don't understand how apple expects you to handle dynamic content. All it needs to solve this is another notification
UIAccessibilityAnnouncementDidStartNotification
Or even better a method to enquire as to whether VoiceOver is currently active. But I don't seem to be able to find any!
Thanks for your time, would really appreciate any tips on this. Cheers!
You want to do two things. First you want to take advantage of the "Updates Frequently" trait. This should improve the behavior of the app when the content is on.
This should help a lot. Then you alse need to provide a way for user to halt the updating content. Independent of whether you do the above, this is an absolute requirement to satisfy WCag 2.0 guideline 2.2.2.

How do I support VoiceOver in UIPickerView on an iPad running an iPhone only app (non-universal)?

Generally I look at Apple's UICatalog sample code for basic VoiceOver support however it looks like there is VoiceOver support for UIPickerViews in the sample code. Do I need to provide an accessibilityLabel method somewhere to add VoiceOver support? I tried to implement UIPickerViewAccessibilityDelegate methods but voice over only reads the labels in my picker view and not the hint to swipe up or down to change the values.
Also my picker view is set to the input view of a UITextField. So I'm not sure if that is relevant or not.
Update:
https://github.com/stevemoser/VoiceOverPicker
I created a sample project demonstrating the issue. In the example there is a normal picker view shown and a textfield. There is also a picker that is set to the textfield's input view property. I can't seem to activate the either picker just by tapping on it while using VoiceOver. Though I can activate either one by swiping (left and right) through the views on screen. Any ideas?
Update 2:
Looks like if the app is an iPhone app running on an iPhone or an iPad app running on an iPad it works fine but if it is an iPhone only app running on an iPad, tapping to select a UIPickerView doesn't work.
Are you just doing a vanilla UIPickerView using titles for each row (and not custom views)? If so, there isn't anything that you should have to do.
You mentioned that VoiceOver was correctly reading the label on each row, so we know that the UIPickerView correctly has isAccessibilityElement set to YES. It's also correctly reading the accessibilityLabels.
Is it possible that you're interacting with the picker before it has a chance to read the accessibilityHint? (For the benefit of others, the accessibilityHint is the "swipe or down with one finger to adjust the value" that Steve mentioned in his question.) Or perhaps some notification is changing the VoiceOver focus before the hint has a chance to be read?
By default, if your picker view is accessible, when you focus on it with VoiceOver it will read the something along these lines:
"[ROW LABEL] Adjustable [#number] out of [#total] picker item" a 2 to
3 second pause then "Swipe up or down to select value"
A few of things to note:
There is a 2 to 3 second delay between reading the label and the hint, make sure you wait for it.
If you're providing your own hint, the default one will not get read I believe
Hints are only read when you reach a certain control by either directly pressing it or by swiping right or left to the control. it will not get read if you do a 2 finger swipe down or up.
Make sure you're testing on an actual device and not a simulator as it does not show all of the things VoiceOver announces.

IOS prev/next button close keyboard unexpectedly

I'm currently using PhoneGap (Cordova) to build an App on iPad/iPhone.
One of my page in the app (in html/css/js), have more than 100 input type Number.
When i use finger to target each of them, it's working like a charm.
But when i use the prev/next button from IOS Keyboard, sometime, i don't know why, keyboard slide to down and when i try to open it again with targeting a input with my finger keyboard just blink... Impossible to fixe it without a scroll to release all event.
I've clean my code, refactored some part, look on google and stackoverflow if someone had the same problem but i found nothing...
Did someone know if it's a UIWebView problem ? Or phoneGap? or something else?
Thank's for reading.
If you are happy to just remove the next/previous buttons from your app entirely, the new Phonegap/Cordova 2.6.0rc1 has made this incredibly simple.
In your config.xml file, just set the HideKeyboardFormAccessoryBar preference to true.
In order for those two buttons to work you need to specify their behavior and it seems that it is not specified. Made some research and I think you have two options. Either you get rid of the next/previous buttons at all like explained here or you override textFieldShouldReturn: in a way similar to what is described in this post.

Resources