title: iOS XCTests - how to verify checkbox button is checked or not
body: <p>I am trying to verify if a checkbox is checked or not for my XCTests code.
  I see that the checkbox is checked in UI but my code returns "NO"
  Help is appreciated. Below is my code</p>
  
  <pre><code>XCUIElement *checkBox = [[[[textField childrenMatchingType:XCUIElementTypeOther] elementBoundByIndex:1] childrenMatchingType:XCUIElementTypeButton] elementBoundByIndex:1];
  
  BOOL isChecked = checkBox.isSelected;
  </code></pre>
  
  <p>isChecked returns "NO" even when checkbox is selected</p>