| Flutter iOS Embedder |

Instance Methods | Class Methods | Properties | List of all members
SemanticsObjectContainer Class Reference

`#import <SemanticsObject.h>`

Inheritance diagram for SemanticsObjectContainer:

## Instance Methods
(instancetype) | - NS_UNAVAILABLE
(instancetype) | - initWithAccessibilityContainer:
(instancetype) | - initWithSemanticsObject:bridge:

## Class Methods
(instancetype) | + NS_UNAVAILABLE

## Properties
SemanticsObject * | semanticsObject

## Detailed Description

Represents a semantics object that has children and hence has to be presented to the OS as a UIAccessibilityContainer.

The SemanticsObject class cannot implement the UIAccessibilityContainer protocol because an object that returns YES for isAccessibilityElement cannot also implement UIAccessibilityContainer.

With the help of SemanticsObjectContainer, the hierarchy of semantic objects received from the framework, such as:

SemanticsObject1 SemanticsObject2 SemanticsObject3 SemanticsObject4

is translated into the following hierarchy, which is understood by iOS:

SemanticsObjectContainer1 SemanticsObject1 SemanticsObjectContainer2 SemanticsObject2 SemanticsObject3 SemanticsObject4

From Flutter's view of the world (the first tree seen above), we construct iOS's view of the world (second tree) as follows: We replace each SemanticsObjects that has children with a SemanticsObjectContainer, which has the original SemanticsObject and its children as children.

SemanticsObjects have semantic information attached to them which is interpreted by VoiceOver (they return YES for isAccessibilityElement). The SemanticsObjectContainers are just there for structure and they don't provide any semantic information to VoiceOver (they return NO for isAccessibilityElement).

Definition at line 227 of file SemanticsObject.h.

## Method Documentation

## ◆ initWithAccessibilityContainer:

- (instancetype) initWithAccessibilityContainer: |  | (id) | NS_UNAVAILABLE |

## ◆ initWithSemanticsObject:bridge:

- (instancetype) initWithSemanticsObject: |  | (SemanticsObject*) | semanticsObject
bridge: |  | (fml::WeakPtr<flutter::AccessibilityBridgeIos>) | NS_DESIGNATED_INITIALIZER

Initial value:
{
fml::WeakPtr<flutter::AccessibilityBridgeIos> _bridge

Definition at line 864 of file SemanticsObject.mm.

891 :(SemanticsObject*)semanticsObject
892 bridge:(fml::WeakPtr<flutter::AccessibilityBridgeIos>)bridge {
893 FML_DCHECK(semanticsObject) << "semanticsObject must be set";
894 // Initialize with the UIView as the container.
895 // The UIView will not necessarily be accessibility parent for this object.
896 // The bridge informs the OS of the actual structure via
897 // `accessibilityContainer` and `accessibilityElementAtIndex`.
898 self = [super initWithAccessibilityContainer:bridge->view()];
899
900 if (self) {
901 _semanticsObject = semanticsObject;
902 _bridge = bridge;
903 }
904
905 return self;
906 }
SemanticsObjectContainer::semanticsObject
SemanticsObject * semanticsObject
Definition: SemanticsObject.h:235
SemanticsObject
Definition: SemanticsObject.h:32

References SemanticsObject::bridge, and SemanticsObject::uid.

## ◆ NS_UNAVAILABLE [1/2]

- (instancetype) NS_UNAVAILABLE |  |  |

## ◆ NS_UNAVAILABLE [2/2]

+ (instancetype) NS_UNAVAILABLE |  |  |

## Property Documentation

## ◆ semanticsObject

- (SemanticsObject*) semanticsObject
| read write nonatomic weak

Definition at line 235 of file SemanticsObject.h.

The documentation for this class was generated from the following files:

- shell/platform/darwin/ios/framework/Source/SemanticsObject.h
- shell/platform/darwin/ios/framework/Source/SemanticsObject.mm