There is a function that creates random text let s = randString() . Text is written to the text field.
How to find this text (variable s on the screen?)
There is a function that creates random text let s = randString() . Text is written to the text field.
How to find this text (variable s on the screen?)
var viewToFind:UITextView; for (_, item) in self.view.subviews.enumerate() { if(item is UITextView) { if((item as! UITextView).text == "test text") { viewToFind = item as! UITextView print(viewToFind.text) } } } go through all the self-view self.view ; if you need to search further down the tree, write recursion
Source: https://ru.stackoverflow.com/questions/527955/
All Articles