I am looking for a way to identify a subview object while iterating inside a for-loop, I basically get all subviews from a UITableView's contentView by doing cell.contentView.subviews.

for SubView in cell.contentView.subviews {
   // check if it's the correct subview

basically thats how I get the subview objects into a loop, while I can see that I got multiple objects in there I need to somehow identify these, in C# a key named simply as name is defined as such:

object.name = "something"

and then retreived in a for-loop by:


but this doesn't seem to be a possibility in Swift, how would I go about identifying an object if I got multiple occurrences of let's say a UILabel?

Related posts

Recent Viewed