Learn Courses My Dashboard

Textview, imageviews

How to make impossible to type a text in text view, where is created an imageview?
The situation is: when user hits button to create a new uiimageview, its placed somewhere in the textview, then because user can type anywhere in the textview, the text can be under the imageview. Then how to fix it (except adding some symbols into the text in uitextview because symbols can be deleted by user)?

its hard to visualize that you are trying to accomplish… I’m also not sure if it is even possible to put a UIImageView inside a UITextView… i suppose closest thing that can mimic this in some sort of UICollectionView that you can add text and images per row of data

You can do this but how to make impossible typing text under an imageview added into textview- that was the question. Now I have another question, how to add uiimageview into the textview under the text as not to make text invisible? Or where to search the information?

maybe try this article if it can help? Programmers Sample Guide: iOS Swift insert Image and Text in UITextView example

i think what you are trying to do is really hard though and it would be much better to just use a text editing tool like google docs for it…

if you still want to code it then i think the uicollectionview approach might be better or some sort of custom view/viewcontroller