Hi Apple,
I'm implementing a custom text view by conforming to UITextInput and backing it with TextKit2.
However, I like the UITextItem feature of the default UITextView. Can I get some guidance on how to reimplement it?
Are we looking at overlaying UIMenu buttons? Or some API where I can display a UIMenu at a rect I specify? Hopefully, it is not some kind of private API?
Thanks for the help in advance.
Post
Replies
Boosts
Views
Activity
In TextKit 1, I can override drawBackground(forGlyphRange:at:) in NSLayoutManager to do custom background drawing. However, I'm not too sure what the designated way of doing background drawing is in TextKit 2.
One thing I've tried is to do custom drawing in my own CALayer that's used in the configureRenderingSurface delegate callback, but I'm unsure if we are suppose to use this API and steal the textViewportLayoutController.delegate away from _UITextLayoutcanvasView?
Hi TextKit 2 Team,
I'm trying to configure my own custom rendering surface when using UITextView(usingTextLayoutManager: true).
What I'm currently doing is adding a "contentLayer: CALayer" into my UITextView and adding my rendering surfaces into that.
The issue I'm running into, is that the rendering surface will display the first character I input, but then will not update for subsequent text until:
It becomes long enough to cause a line wrap.
I hit return.
Not sure if I'm doing something wrong? So my questions are:
Is using configureRenderingSurface API intended to be used when I'm using UITextView? Or it's only meant for when I do fully custom InputView?
Should I be inserting my rendering surfaces into my contentLayer or is there some more appropriate place for me to insert into?
How do I properly trigger redraw or invalidation of my rendering surface on text editing changes? Is this a bug or do I have to trigger an update manually somewhere?
Many thanks in advance!
Hi TextKit team,
How do I access the textContentStorage of UITextView that is usingTextLayoutManager: true?
I'd like to use the NSTextContentStorageDelegate methods, but unlike NSTextView where it has a property for textContentStorage, it seems UITextView doesn't expose this?
Thanks for your help in advance!
Cheers / Leo
Hi TextKit2 Team,
I'm trying to find the link to download the TextKitAndTextView sample code that was mentioned in the "What's new in TextKit and text views" video. I can't seem to find a link to it anywhere though.
Cheers / Leo