
|
|
![]() Commands correspond to user interface actions, and actions are directed to components. For example, a command might specify to Touch a UIButton. If there is only one UIButton on the screen, FoneMonkey knows which button the command is referring to. If there are multiple buttons, however, we must tell FoneMonkey which one we mean. In addition to the component's Objective-C class name, and a unique identifier called a monkeyID (generated by FoneMonkey). For any command, you can specify just a className or a monkeyID, or you can specify both. Component Identification Examples If there are multiple buttons on the screen: Touch UIButton "Done" If there is just one button on the screen: Touch UIButton If threre is just one button on the screen with a monkeyID of "Done": Touch "Done" FoneMonkey's UIView extensions provide the default monkeyID for all components. By default, the monkeyID of a component is the value of its:
Many component types provide specialized monkeyID's. For example, UIButton returns its titleLabel.text as its monkeyID, and UITextField returns its placeholder value. See the FoneMonkey Command Reference for a description of the monkeyID's returned by each component type. If a component provides no monkeyID, FoneMoney generates an identifier by assigning an ordinal to each instance of each class on the screen. FoneMonkey generated monkeyID's are prefix with a #-sign. Examples of Generated MonkeyID's Touch the first button: Touch UIButton #0
Touch UIButton #1 |