Detect address in UITextView - ios

I have a UITextView with dataDetectorTypes set to UIDataDetectorTypeAll (which should include UIDataDetectorTypeAddress), but no matter how I write an address in the text view it's never detected as a link.
Should the address be written in some kind of special format for it to work? Phone numbers, urls, emails and calendar events work perfectly.

Related

How to differ whether the content text of UITextView is still under spelling or a real text?

As the following screen shot shows, for many languages, it needs a spelling to compose a target character, such as Chinese, Japanese, etc.
And for both statuses (the status that showing your original spelling input and the status that showing the composed characters), they are just the same as UITextView.text, and as it's not a real user selection, so the selection range also doesn't working for telling the "under spelling" text.
Is there any way to tell whether the current content text of UITextView is a composed characters or still under spelling?
Thanks for the help!

Loading a number with special characters in the dialler programmatically

I read from from this post that Apple does not allow numbers with special characters * and # to be dialed programmatically for security reasons.
Can a number with special characters be loaded programmatically (displayed in dialer) so that the user has to simply press the call button?
I would like to emphasise that I just want the number to appear in the dialler programmatically without calling the number. This is different from some of the posts I've seen here.

Swift: Disable symbols on Phone pad

I'm trying to disable symbols(+, *, #) on phone pad either programmatically or from storyboard. I have been searching for useful resources online but wasn't successful.
Is there any better way to get this done?
EDIT
I'm using a UITextField for which I have set the keyboard type to Phone pad.
You are using the "Phone Pad" keyboard but you don't want the phone pad symbols. The solution is simple - don't use the "Phone Pad" keyboard. Use the "Number Pad" keyboard instead.
Keep in mind though that users can use external keyboards or they can paste text into the text field. So you can't rely on the keyboard to ensure that only certain characters are entered into the field.
You must also do proper validation by implementing the appropriate UITextFieldDelegate method textField:shouldChangeCharactersInRange:replacementString:.

How to get the fonts being used in a UILabel and the ranges they span for PDF generation?

I'm currently developing an iOS app that at a very high level allows a user to enter text into a text box that will get sent to a server for incorporation into a dynamically generated PDF. The server uses Node.js & PDFKit.
We are localising the app for pretty much every language supported by iOS. The text the user enters is UTF-8 encoded when sent to the server. The problem I face is knowing which font (or fonts) to use server side to ensure the characters show up correctly in the server side generated PDF.
In the iOS client app there is a single UILabel showing a preview of the text a user has entered into a UITextField. The UILabel showing the preview has a single custom font applied that only has support for Greek & Latin characters. Interestingly when a mixture of characters are entered from different alphabets (possible if the user has multiple keyboards) latin, cyrillic, etc. they display correctly in the UILabel despite the fact the custom font does not support them:
I guess there is some kind of "font fallback" going on, however as the client app is being localised to support many languages this behaviour is desirable.
My question is how can I know server side which fonts are being used, and the range of characters they cover in the preview UILabel? Somehow I need to replicate this behaviour server side so that the text in the generated PDF approximately matches the client preview.
Alternatively is it possible to determine server side what fonts I should use for a given character?

Keyboard recreation for security reason

I need to recreate custom keyboard with four levels: lowercase, uppercase, special characters and special characters when shift is pressed. I do not want to create plist file where will be placed all characters for each level. I am looking for the solution to get it using native framework.
What is the way to get characters set for each level?
Characters set should depend on language. Lets say German layout is different to UK layout.
Answer to the “Why?” question: For security reason as written in iOS Security guid at p.20 it is better to present custom keyboard to the users. As my text field have functionality hide/show password my UITextView can be in the mode not secure.
Once enabled, the extension will be used for any text field except the
passcode input and any secure text view.

Resources