How to allow text highlighting in an iPad app? - iphone

I'm making an iPad magazine app where the user will be able to highlight any amount of the text. These highlights will need to be saved and appear everytime that article is loaded.
Can I do this somehow with CoreText (which is currently what I am using to allow multi-columned formatting)?
I have noticed that selecting text using HTML in a UIWebView doesn't work properly if there are images within the text.
Anyone have any advice?
Thanks a lot,
-Chris

There's no built in support in CoreText for selection or "Copy & Paste", but you can make your own selection engine using some CoreText functions.
Take a look at this other topic post.
Core Text - select text in iPhone?

Related

How to select text in DTAttributedTextView?

I'm using DTCoreText DTAttributedTextView in my app to highlight the urls in my text. My other criteria is to be able to select by tapping and holding similar to UITextView. However, DTAttributedTextView doesn't seem to to use a UITextView as a placeholder. Anybody has an idea how I can achieve this?
Thanks
That's a feature that's only available via the paid version of DTCoreText.
from the github page
This is useful for drawing simple rich text like any HTML document without having to use a UIWebView. For text selection and highlighting (as you might need for an Editor or Reader) there is the commercial DTRichTextEditor component which can be purchased in the Cocoanetics Parts Store.

How to copy and paste custom emoticon

I want to copy custom emoction from my iphone app and want to paste in anywhere in textbox inside or outside my application or i can use it in comments on instagram and facebook.I got reference app https://itunes.apple.com/au/app/emoji-for-facebook/id652079241?mt=8 that same i want to apply in my application.
can anybody help me,how do i achieve this mechanism? my custom emoticons are stored in collection view as a image.how do i copy image and paste it into comments on social networking.
The emoticons used in text are in fact Unicode characters. So the "custom" emoticons are just using a special font, not images. The app you're referencing simply seems to use the same font as the Facebook app.
So the real answer is: you copy and paste them like normal text. And you cannot control how they will look like in other apps, as that is dependent on the font the other app is using.

Display Rich Text Content as UIWebView or UILabel+CoreText

I'd like to display rich text content in my app. I want user to create simple WYSIWYG input with support of bold, italics, shadow, outline, image HTML-like tags. I am puzzled if I should go with UIWebView or custom written UILabel/UIView which can have CoreText framework added to support all those above stated properties. I see there are libraries which are using both approaches.
Does anyone have an experience dealing with these approaches who can suggest cons and pros? Thanks
The web view approach has quite an overhead and likely a delay to display the rendered text. I would recommend using DTCoreText.

Is UITextView enough for a simple writing app?

I'm trying to make a simple writing program, like Notes app for iPad, with a custom keyboard.
From OmniGroup's text editor open sources, I learned that UITextInput is mainly required to develop great text editor capable of having several fonts and size in one editor.
But it seemed tough to implement a lot of methods in UITextInput Protocol in order to build a text editor from scratch.
Do you think UITextView is enough to make a simple writing program?
Do most writing apps in AppStore use their own framework using UITextInput?
Thank you!
UITextView is the ideal view to display and edit multiple lines of text. You can format the text using font, size and color. The only formatting restriction is that you can have only one text format for the whole view. The Notes app written by Apple is a typically use of UITextView.
Check Apple documentation for more...
Cheers

Is CoreText just a draw/layout Framework for text?

Im using CoreText to display some text, creating framesetter, frames and so, and everything is fine. I can even format the text, but this all is done before I draw. Now the question that is driving me crazy:
CoreText is just to render text? I cannot get any reference to CTRuns or Glyphs to highlight them?
Another sub big question, the Pages App dont use CoreText, anyone knows? In Pages, you can select any already drawn styled text!
All I want is to draw the text and be able to let the user tap to select any text or doubleTap to select the paragraph.
Please, anyone, any light?
Thanks in advance.
CoreText is just to render text. Implementing user interaction is quite another matter. You need to implement UITextInput protocol, see here. It's a big job.
If you just want to input text and don't have a need for advanced typography, just use UITextView or UIWebView.
you can get image bounds of CTLines and CRRuns via core text here is little example i made for my app it's not perfect yet but you can get a little idea of how it works.
textViewProject