def __iter__(self):
<EOL>if not self._query_multiple:<EOL><INDENT>nodes = self._do_query(multiple=True, refresh=True)<EOL><DEDENT>else:<EOL><INDENT>nodes = self._nodes<EOL><DEDENT>length = len(nodes)<EOL>sorted_nodes = []<EOL>for i in range(length):<EOL><INDENT>uiobj = UIObjectProxy(self.poco)<EOL>uiobj.query = ('<STR_LIT:index>', (self.query, i))<EOL>uiobj._evaluated = True<EOL>uiobj._query_multiple = True<EOL>uiobj._nodes = nodes[i]<EOL>uiobj._nodes_proxy_is_list = False<EOL>pos = uiobj.get_position()<EOL>sorted_nodes.append((uiobj, pos))<EOL><DEDENT>sorted_nodes.sort(key=lambda v: (v[<NUM_LIT:1>][<NUM_LIT:1>], v[<NUM_LIT:1>][<NUM_LIT:0>]))<EOL>for obj, _ in sorted_nodes:<EOL><INDENT>yield obj<EOL><DEDENT>
Similar method to :py:meth:`.__getitem__() <poco.proxy.UIObjectProxy.__getitem__>` with the difference that this
method iterates over all UI elements. The order rules of UI elements is same as for :py:meth:`.__getitem__()
<poco.proxy.UIObjectProxy.__getitem__>`. See ``IterationOverUI`` for more details.

Yields:
    :py:class:`UIObjectProxy <poco.proxy.UIObjectProxy>`: a generator yielding new UI proxy represents the
    specific UI element iterated over

Raises:
    PocoTargetRemovedException: when hierarchy structure has changed and it is attempted to access to the
     nonexistent UI element over the iteration