SwiftUI or UIKit is welcome.
SwiftUI or UIKit is welcome.
Usually, it is better UI to have text in a scrollView than in different cards.Splitting text into cards
That will be harder for user. You'd better keep a title, adding "Cont'd" at the end.the title must appear once on the first card
you can have several cards (VCs) or only one in which you will change the content of textView and title.
Code Block func boundingRect(with size: CGSize, options: NSStringDrawingOptions = [], context: NSStringDrawingContext?) -> CGRect
startPoint = first char
endPoint : last char of next word
compute the rect
it it fits, test with next word for end point
if does not fit, keep the previous endPoint: that is where you have to split
To know what part of text will fit in the rect of the textField, Label, whatever it is.
For the first card, one need to find what is the last word that can fit into the rect.
Loop from first word to following words, compute what would be the needed rect to display (with func boundingRect), and continue as long we don't hit the end of text or exceed the size of available rect.
When the loop ends, we get the subtext from first word to the last that fits.
And put this text in the display zone
when user asks for next card, redo the same, but the new first word is the one just after last word of the previous card.
Unless you clarify what you want to do, your question will not be answered.I did not receive an answer, and if I did, I could not understand and implement it.
You should better show some example inputs:
Seems there are nothing I can help. Good luck.I just don't really understand what the input is.