iOS sharing images with text in messages like Emoji - ios

The goal is to be able to insert images with text when sharing text into an SMS Message from the App as well as in e-mails. Like it is in the picture below. When I try to share images with the UIActivityViewController the images appear on the next line and not next to the text. Is it possible to embed images in text and e-mail like the built in Emoji text?

The contents of text messages are just that, text (that is, a sequence of Unicode code points.) The emoji images you see in the screenshot come from a system font installed on all iOS devices, and are represented in the text as unicode code points, just like the other regular letters in the same message.
If you want to embed custom images into text fields in your app, you can create a custom font that includes the desired graphics (for some code points in the Unicode private use area,) include the font in your app as an asset, configure your text fields to use that font, and then provide some UI for the user to type those code points in.
But remember that this will only work on devices that have your custom font installed, and in apps that choose to use that custom font to display the text — so essentially only in your own app. So for example if you'd send the text in an email or iMessage/SMS to another device, your custom graphics would not work unless a) the receiving device has your custom font installed system-wide, and b) the app displaying the text resolves the Unicode private use area code points you chose to use for your images to this custom font of yours.
If you only want to embed images into text fields within your own app, on iOS 7 and later you can use the text attachments feature that TextKit supports.

Related

How to use non-English characters in Godot?

I want to use non-English characters in Godot, but when I write them (In every node, like a Label or a Button) and run the project, the text does not display. For example, I write some Arabic characters in a Label and run the project, but I do not see anything. But I can see the characters in editor separately and reversely. ("عالم" is displayed "م ل ا ع")
I know that this problem is discussed on GitHub, but there was not any good solution. Please advise me a good and simple solution to solve this problem. I think it is not solved so far.
The default Label font in Godot doesn't support non-ASCII characters.
You can try to change the font in your Label node to one that supports non-ASCII symbols by picking a font from your computer, or if it doesn't exist on your device, uploading it from some site like Google Fonts, and choosing an arabic-supporting font, like Amiri.
After choosing the font for your Label node, open the Custom Fonts property in the editor of the node, and create a DynamicFont, and in Font => Font Data press Load and choose your font in the opened window in the file system (.ttf or any another font extension).

iOS keyboard extension paste video files to third party apps?

I have been working on an iOS keyboard extension that sends video files through iMessages.
This functionality works fine with copy + paste methods but when trying to copy + paste into a third party app (IE: Facebook, WhatsApp, Line etc) the "paste" option does not show up.
Is there some way I can get these files to be pasted into these apps? Or is this not possible on iOS?
Thanks in advanced!
Different Apps have different behaviors that are allowed in their textfields, as specified by the developers of those Apps. You can't force them to accept content that they don't want to.
Generally, most popular Apps with text input either support copy-pasting images directly, or will automatically download and display the contents of links that the user copy pastes.
You should check out Riffsy, the last time I used their GIF Keyboard App they had a feature where if you long pressed on a GIF, a list of social media apps appeared, and selecting one of them performed the appropriate action to display an image in text fields in that App.
If you want to copy + paste any image, GIF or any video file that was loaded in your custom keyboard into any other app(i.e third party apps) other than the iMessage, That app input view(i.e text fields or text views) must support the images etc. If they don't support the images or videos you can't paste it in that input view.

Supporting Drop Caps in Text Kit

I’m building an iOS reader app where I need to be able to highlight selections of text and optionally link notes with highlights. I’ve begun by using Text Kit (UITextView, NSAttributedString). I am targeting iOS 7, 8, and 9.
My problem is that I need to be able to support Drop Caps on certain paragraphs in the content. This means the first letter of a paragraph is the height of 2 lines of text and the first 2 lines of text appear beside it, then the remaining lines wrap under. My content has many drop cap characters on various paragraphs throughout.
Example showing 4-line drop cap.
Text Kit: Exclusion Paths
My initial assumption was that I would use Text Kit exclusion paths so that paragraph would wrap around it. But I can’t figure out a way to determine the exact placement of the exclusion paths and I wasn’t sure if these would float along as my content scrolls. With this approach, I would also have to manually handle text selection of the Drop Cap characters, which I’d like to avoid.
Text Kit: NSTextAttachments
I was hopeful that I could use inline Text Attachments (NSTextAttachment), but I can’t determine a way to have 2 lines wrap beside it.
Core Text
I found a couple older (pre-TextKit) examples of Drop Cap implementations using Core Text, however, every one showed only the first character of the content as a Drop Cap and not multiple paragraphs throughout the content as I need. I was hoping to avoid Core Text also since I’d rather not handle text selection manually.
https://stackoverflow.com/a/14469897
https://stackoverflow.com/a/14639864
https://stackoverflow.com/a/9272955
Current Hope/Question
NSTextAttachment feels like the simplest approach. Is there a way to wrap 2 lines of text beside it?
Fallback... I’m beginning to wonder if I should switch to WKWebView and drop iOS 7 -- since HTML supports drop caps and WKWebView provides more performance than UIWebView.

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?

changing the color of Phone number(UITextView...with detect Phone Number enabled in xib file) in objective c

Can we change from default blue color of Phone number(UITextView...with detect Phone Number option enabled in xib file) to other color in objective c?
For example number like 00471122345 shown in blue color in app which is not suiting by application back ground.
You can't change the default text colors in a UITextView. If you want control over text colors, the best way is to use UIWebView. It even has built-in detect phone numbers, if you want that. In a web view, you can change the text color, the background color, the link color, the visited link color, etc. just like on a normal web page.
(You can also do fancy alignment, tabling, add images, put have different parts of text be different size/font/color, etc. It's just a web page! :)

Resources