How to add a dynamic textfield in a label? - swift

I want to create an app which helps me to improve on my English. I have a couple of English sentences stored via Realm on the device which will be displayed in the app. I have to enter the correct verb form including the tense. I used Apples Natural Language Module to filter out the verb forms and replace it with underscores.
The sentences are displayed in a UILabel, but instead of underscores, I want to have a UITextfield where the underscores are (so inside the label), so that I can write directly in the sentence instead of having a UITextfield below the sentence. How can I achieve this?

Related

How can I dynamically style sections of text in flutter?

Say I had text that the user was inputting into a big text box. I also want my app to be testing if any of the text inputted is in an array, and if it finds them then style these differently (For example highlight them wit ha yellow background). So if the phrases I was looking for were 'cake is great', 'people are awful' and 'scooters are the best', and the user wrote 'I really love my cake, cake is great' is it possible for flutter to see this text, and add a text style purely to the last part of the sentence, or otherwise style it differently?
How would I go about doing this?
Using substrings should do the trick, if anything else is trying to do something similar look here!
https://pusher.com/tutorials/styled-text-flutter#text-styling-with-the-text-widget

Different keyboards for editing different text fields

I have three editable text fields in my app. When user enters text in the first text field, the English keyboard should show up, in the second - Spanish, in third - Chinese, etc. Everything else in the app should stay in English.
If possible, the languages could be selected dynamically by the user from the list of available locales (I don't need help with selecting the language):
https://docs.flutter.io/flutter/flutter_localizations/GlobalMaterialLocalizations-class.html
The closest that I found to what I want is described here: https://medium.com/saugo360/managing-locale-in-flutter-7693a9d4d6ac
but I wonder if there is a way to make it less intrusive: like making it a property of the TextEditingController
This shouldn't be done by the application.
Keyboards are installed by user and user knows how to switch between them.

Formatting text in a list in app inventor 2

I have a list that I want to display some text as bold and other parts not bold. First of all I have been accomplishing this when not inside of a list by just making a bunch of labels and then manually going through the text adding \n and spaces for formatting, which takes forever. If there is an easier way of doing that I would love to know. Anyway my question is how can I add formatted text to a list.
So instead of those individual text elements I want to add multiple formatted text elements in place of one.
how can I add formatted text to a list
sorry, that's unfortunately not possible with App Inventor
you can take a look at this App Inventor Classic example, which uses some HTML to do the formatting

What is the logic behind dictionary word search and auto suggestion in iPhone?

I want to develope an app that is similar to dictionary in MAC. what is the logic to show the words related to the letters typed in textfield and if the word does not exists how can i suggest the words dynamically depending on the letters typed?
You can only suggest those words if you've got a database of words already. The logic is that you request all words that start with what user has typed in from your database and show results in a table view.
Look up "radix tree" for some ideas on how to do fast word completion.

Adding hyperlink to any text in UITextFiled and perform a custom action - iPhone 4

I am trying to accomplish the following:
Read and Parse the text in a UITextField. Identify all the numbers in the UITextField and convert these into hyperlinks.
When these hyperlinks are clicked perform a custom action, which is to display a UIActionSheet and based on the selection assign the number (in the hyperlink) to another UITextField instance
For example if the UITextField has the text - "This is a sample test with number 123445 and more numbers 44555, 66777".
I should be able to parse the above text, detect all three numbers and add hyperlinks to them.
For the first part (parsing) I found out that there is a NSRegularExpression class that can be used to detect patterns in a text. But I could not find a way of adding hyperlinks to the matched numbers. I tried looking at Three20 documentation and could not figure out a way. Even tried the answer in this link - Just how to you use TTStyledTextLabel? but it only auto detects URLs and adds hyperlinks to them, I want to add hyperlinks to any custom text.
Can someone please help me with this. Please do not ask me to use WebView. I would really appreciate some code snippets. Thanks in advance. I am using xCode4.
If you don't need the text to be user-editable directly, you may use my OHAttributedLabel class to achieve this. (here on github)
This allows you to display any NSAttributedString and can also autodetect links, phone numbers and everything Apple's NSDataDetector class is able to detect. You can also add custom links to your label on any part of the text.
See the sample project included in my github repository for more details.
It is very customizable, both for link colors, underline style, action to perform when a link is tapped, which link types it should autodetect, and you can add any custom links and style you need on the text.