-
Notifications
You must be signed in to change notification settings - Fork 5
Simple Pattern
A simple pattern assesses an individual view against a single criterion.
Types of simple patterns. There are four simple patterns:
Combining simple patterns. Simple patterns may be combined to form instance patterns that assess multiple criteria.

A class pattern matches a view whose class meets specified criteria.
-
c— member of class pattern — matches a view that is an instance of the class namedc. -
c*— kind of class pattern — matches a view that is an instance of the class namedcor is an instance of a subclass of the class namedc. -
*— universal pattern — matches a view of any class.

An identifier pattern matches a view based on the value of an "identifier" property.
-
#i— tag identifier pattern — matches a view with atagproperty whose value is equal to the integeri. -
#s— identifier string pattern — matches a view with anaccessibilityIdentifierproperty whose value is equal to the strings. -
#w— identifier word pattern — matches a view with anaccessibilityIdentifierproperty whose value is equal to the wordw.

A predicate pattern matches a view that satisfies a predicate expression.
-
[p]— predicate pattern — matches a view that satisfies predicate expressionp.

A position pattern matches a view that bears a specified relationship to its superview, subviews, or sibling views.
-
:root— matches a view that is the root view in the visible window. -
:empty— matches a view that has no subviews. -
:first-child— matches a view that is the first child of its superview. -
:last-child— matches a view that is the last child of its superview. -
:only-child— matches a view that is the only child of its superview. -
:first-of-type— TBD -
:last-of-type— TBD -
:only-of-type— TBD
In the following patterns,
r is a repeater.
-
:nth-child(r)— TBD -
:nth-last-child(r)— TBD -
:nth-of-type(r)— TBD -
:nth-last-of-type(r)— TBD