Highlight text while Text to Speech is running - ios

I am developing an app for ipad in which i want to add functionality as below:-
When user'll tap on play button Text to speech will start to play that Text at that time, that word will be highlighted as they are being read.
I know about in built feature of iOS but i want to do it programatically.
I searched a lot and got as below:
Link 1
Link 2
Link 3
If anyone know any API or any inbuilt framework. Let me know.
Appreciate your time.

You can make use of the brilliant text-to-speech library inbuilt with iOS 7 onwards called AVSpeechSynthesizer.
You can control the speech as well as get notifications of it's progress using the AVSpeechSynthesizer delegate methods. The method that should help you achieve your desired functionality should be the
speechSynthesizer:willSpeakRangeOfSpeechString:utterance: method.
Have a look at the AVSpeechSynthesizer as well as the AVSpeechSynthesizerDelegate API reference.
This post by Matt Thompson on NSHipster features the exact same functionality with an example.

Related

Local notifications with unknown content at time of request in Swift [duplicate]

I have implemented iOS rich notifications in my app based on Local and Remote Notification Programming Guide.
I watched WWDC Introduction to Notifications, Advanced Notifications, and Best Practices, and read UNNotificationContentExtension. All of these show that I can implement Notification Content extension to customize notification presentation. But to me it seems that they all assume that we can customize only the expanded view (the view that opens up when we 3D press the short preview).
Now I know that I can customize the presentation of the short preview in a very restricted way - using title/body I can decide if I want a bold or normal font; by using Notification Service extension I can add a media preview. However, what I need is to be able to build the UI of this short preview myself - add custom UIImageView, etc. Right now it seems that this is not possible, but I wasn't able to find any explicit information that would confirm it.
So my question is: Can we customize the short preview of a notification? If not, is there any explicit statement in official docs that explain this? If yes, can you refer me to some docs/tutorials on how to do it?
I just stumbled upon the following line in the Customizing the Appearance of Notifications article in the official documentation:
The system provides the interface for the abbreviated banner, but you can customize the full interface using a notification content app extension.
This confirms that currently there is no way of customizing the short preview ("abbreviated banner" in the docs).
I think (I'm not 100% sure) that you can only display an Attachment Image in the Notification banner, because you don't have Storyboad or UI file for this. It is the default Notification banner design.
You can follow this great guide (links below), it helps me understand Notification Content Extension and Notification Service Extension and all the logic behind and how it really works.
You can try to make some adjustments to the project, trying with anything else than ImageView, but as far as I know, the attachment is by default positioned at the right corner, as a miniature.
I am interested if you find additional informations.
Here is the great links that helped me build my Notification Feature in my App.
Sources:
Rich Notification Guide
Notification with Attachment
PS: I am also sad and disapointed that the expended view only appears with 3D Touch (People don't use it, 3D Touch is a failure to me).

How do i know when a double click is made on focused element with voice over accessibility?

Facing an issue where double tapping with voice over on, the link inside focused UITextView is not opening in Safari in iOS 9. It works fine in iOS 10 and 11. Any suggestions for same?
Also i need to know when the user double taps on screen to perform action on focused item with voice over on , also which view was in focus?
Thanks in advance!!
FIRST QUESTION: to open a link in a UITextView, there's a specific VoiceOver gesture I already explained in a detailed answer and that should always work.
SECOND QUESTION: if you want to know the focused element on which a double tap is made, the best way is to use the UIAccessibilityFocus informal protocol using the accessibilityElementIsFocused method for instance.
Take a look at the provided links where code snippets are available (Objc + Swift).

Voice to Text on iOS10?

I'm Deaf and curious if there is the possibility to point the iPhone toward a speaker and see its text on the screen?
Not sure if iOS10 comes with that Voice to Text functionality or if an external app is required for this?
Thanks for any suggestions!
As developer's point of view in ios 10 there is speech.framework which can use to convert voice to text
for reference you can refer speech.framework

how to display text in iOS as a fire using particle system

I am making a game wherein I need to show score text written with fire animation one letter at a time.
I am aware of the particle system in iOS but how do I plug it in to say an uttextview ? If anybody can provide some sample code it will be of great help.
I am currently looking at this tutorial.
You may use Core Text
Using the core text you can draw the test one by one and can add fire effect as well.

In iOS 8, how to implement long-swipe-to-delete gesture a la Mail.app

In Apple's 2014 WWDC keynote, they showed a gesture in the Mail app that lets you long-swipe to delete a message immediately. This is different than swiping then tapping the delete button. Below is a screen shot of it in action. Does anyone know if this is available as a public API yet? I've looked through the WWDC session videos and the documentation to no avail.
I would prefer to use native APIs rather than custom classes if possible; this is why I'm asking.
Thanks in advance.
I found that it wasn't possible with a standard tableview, you have to implement it yourself with custom table view cells.
There are a number of libraries that do this, I found MGSwipeTableCell to be the best - it has a demo app which replicates the behavior of iOS 8 mail and is a good example.
As of iOS 11, there is finally a formal way to do this using the UIKit APIs. They're called "swipe actions" now, and they can be "leading" or "trailing" and even include an image. The UITableViewDelegate method is called leadingSwipeActionsConfigurationForRowAt. I learned about this from Use Yiur Loaf

Resources