'How to have an editable textview with multiple text containers?

I'm trying to follow Apple's Guide from this link: https://developer.apple.com/library/archive/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/CustomTextProcessing/CustomTextProcessing.html (specifically figure 8-7).

I want to create a text editor for my app, and so I need to be able to have multiple pages that the user can edit. However, according to Apple (https://developer.apple.com/documentation/uikit/textkit/display_text_with_a_custom_layout), adding two or more textcontainers to one layout manager causes the textview to become uneditable.

How do I achieve the sample project (I want my app to have the two-column layout) and also allow the user to edit the textview like a word processor? If the first page is full of text, then the text should start to bleed to the second page, ... e.t.c. (just like a word processor).

By the way, I am using Apple's sample code/project from the 2nd link (specifically the two-column project).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source