How can we make elements which are grouped accessible for automation

I have a stackview which have 2 labels

class TextView: UIView {

@IBOutlet private weak var stackView: UIStackView! {
    didSet {
        stackView.isAccessibilityElement = true
        stackView.accessibilityLabel = label1.text + label2.text
    }
}
@IBOutlet private weak var label1: UILabel! {
    didSet {
        label1.accessibilityIdentifier = "label1"
    }
}
@IBOutlet private weak var: UILabel!{
    didSet {
        label2.accessibilityIdentifier = "label2"
    }
}

} My goal here is to have a combines accessibility label for the stackview and yet able to access the accessibilityIdentifier of child elements for automation.

How can we make elements which are grouped accessible for automation
 
 
Q