Ok, let's start very basic.
Your views start at the root view -- the one you call present on -- and then are heirarchical going down . If you assign a name in the UI editor, you can refer to a subview by name, a but only from it's immediate superview.
Please do the following:. From your button action, call this method on sender.
print('root:', root.name, type(root))
def print_subviews(v, prefix):
print(prefix, v.name, type(v))
for sv in v.subviews:
That will print something like
Etc. Hopefully this helps explain your view heirarchy.
Note that often people create global variables, or attributes in the root view that point to deep subviews...
Then you can simply refer to these in your callbacks functions without having to use superview/subview business in your callbacks. If your button takes action on a specific item, that ends up being cleaner. If instead you have 5 buttons using the same action, then you would use sender. Superview