Flutter iOS Embedder
FlutterSemanticsScrollView.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERSEMANTICSSCROLLVIEW_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERSEMANTICSSCROLLVIEW_H_
7 
8 #import <UIKit/UIKit.h>
9 
11 @class SemanticsObject;
12 
13 /**
14  * A UIScrollView to represent Flutter scrollable in iOS accessibility
15  * services.
16  *
17  * This class is hidden from the user and can't be interacted with. It
18  * sends all of selector calls from accessibility services to the
19  * owner SemanticsObject.
20  */
21 @interface FlutterSemanticsScrollView : UIScrollView <UIScrollViewDelegate>
22 
23 @property(nonatomic, weak, nullable) SemanticsObject* semanticsObject;
24 
25 /// Whether this scroll view's content offset is actively being updated by UIKit
26 /// or other the system services.
27 ///
28 /// This flag is set by the `FlutterSemanticsScrollView` itself, typically in
29 /// one of the `UIScrollViewDelegate` methods.
30 ///
31 /// When this flag is true, the `SemanticsObject` implementation ignores all
32 /// content offset updates coming from the Flutter framework, to prevent
33 /// potential feedback loops (especially when the framework is only echoing
34 /// the new content offset back to this scroll view).
35 ///
36 /// For example, to scroll a scrollable container with iOS full keyboard access,
37 /// the iOS focus system uses a display link to scroll the container to the
38 /// desired offset animatedly. If the user changes the scroll offset during the
39 /// animation, the display link will be invalidated and the scrolling animation
40 /// will be interrupted. For simplicity, content offset updates coming from the
41 /// framework will be ignored in the relatively short animation duration (~1s),
42 /// allowing the scrolling animation to finish.
43 @property(nonatomic, readonly) BOOL isDoingSystemScrolling;
44 
45 - (instancetype)init NS_UNAVAILABLE;
46 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
47 - (instancetype)initWithCoder:(NSCoder*)coder NS_UNAVAILABLE;
48 - (instancetype)initWithSemanticsObject:(SemanticsObject*)semanticsObject;
49 
50 @end
52 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERSEMANTICSSCROLLVIEW_H_
FlutterSemanticsScrollView::semanticsObject
SemanticsObject * semanticsObject
Definition: FlutterSemanticsScrollView.h:23
NS_ASSUME_NONNULL_END
#define NS_ASSUME_NONNULL_END
Definition: FlutterMacros.h:20
-[FlutterSemanticsScrollView NS_UNAVAILABLE]
instancetype NS_UNAVAILABLE()
NS_ASSUME_NONNULL_BEGIN
#define NS_ASSUME_NONNULL_BEGIN
Definition: FlutterMacros.h:19
initWithFrame
instancetype initWithFrame
Definition: FlutterTextInputPlugin.h:172
FlutterSemanticsScrollView::isDoingSystemScrolling
BOOL isDoingSystemScrolling
Definition: FlutterSemanticsScrollView.h:43
FlutterSemanticsScrollView
Definition: FlutterSemanticsScrollView.h:21
initWithCoder
instancetype initWithCoder
Definition: FlutterTextInputPlugin.h:171
SemanticsObject
Definition: SemanticsObject.h:31