UNPKG

3.78 kBtext/x-cView Raw
1/*
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#import <UIKit/UIKit.h>
9
10#import <React/RCTBorderStyle.h>
11#import <React/RCTComponent.h>
12#import <React/RCTPointerEvents.h>
13#import <React/RCTView.h>
14
15extern const UIAccessibilityTraits SwitchAccessibilityTrait;
16
17@protocol RCTAutoInsetsProtocol;
18
19@class RCTView;
20
21@interface RCTView : UIView
22
23/**
24 * Accessibility event handlers
25 */
26@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityAction;
27@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityTap;
28@property (nonatomic, copy) RCTDirectEventBlock onMagicTap;
29@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityEscape;
30
31/**
32 * Used to control how touch events are processed.
33 */
34@property (nonatomic, assign) RCTPointerEvents pointerEvents;
35
36+ (void)autoAdjustInsetsForView:(UIView<RCTAutoInsetsProtocol> *)parentView
37 withScrollView:(UIScrollView *)scrollView
38 updateOffset:(BOOL)updateOffset;
39
40/**
41 * Find the first view controller whose view, or any subview is the specified view.
42 */
43+ (UIEdgeInsets)contentInsetsForView:(UIView *)curView;
44
45/**
46 * Layout direction of the view.
47 * This is inherited from UIView+React, but we override it here
48 * to improve performance and make subclassing/overriding possible/easier.
49 */
50@property (nonatomic, assign) UIUserInterfaceLayoutDirection reactLayoutDirection;
51
52/**
53 * This is an optimization used to improve performance
54 * for large scrolling views with many subviews, such as a
55 * list or table. If set to YES, any clipped subviews will
56 * be removed from the view hierarchy whenever -updateClippedSubviews
57 * is called. This would typically be triggered by a scroll event
58 */
59@property (nonatomic, assign) BOOL removeClippedSubviews;
60
61/**
62 * Hide subviews if they are outside the view bounds.
63 * This is an optimisation used predominantly with RKScrollViews
64 * but it is applied recursively to all subviews that have
65 * removeClippedSubviews set to YES
66 */
67- (void)updateClippedSubviews;
68
69/**
70 * Border radii.
71 */
72@property (nonatomic, assign) CGFloat borderRadius;
73@property (nonatomic, assign) CGFloat borderTopLeftRadius;
74@property (nonatomic, assign) CGFloat borderTopRightRadius;
75@property (nonatomic, assign) CGFloat borderTopStartRadius;
76@property (nonatomic, assign) CGFloat borderTopEndRadius;
77@property (nonatomic, assign) CGFloat borderBottomLeftRadius;
78@property (nonatomic, assign) CGFloat borderBottomRightRadius;
79@property (nonatomic, assign) CGFloat borderBottomStartRadius;
80@property (nonatomic, assign) CGFloat borderBottomEndRadius;
81
82/**
83 * Border colors (actually retained).
84 */
85@property (nonatomic, assign) CGColorRef borderTopColor;
86@property (nonatomic, assign) CGColorRef borderRightColor;
87@property (nonatomic, assign) CGColorRef borderBottomColor;
88@property (nonatomic, assign) CGColorRef borderLeftColor;
89@property (nonatomic, assign) CGColorRef borderStartColor;
90@property (nonatomic, assign) CGColorRef borderEndColor;
91@property (nonatomic, assign) CGColorRef borderColor;
92
93/**
94 * Border widths.
95 */
96@property (nonatomic, assign) CGFloat borderTopWidth;
97@property (nonatomic, assign) CGFloat borderRightWidth;
98@property (nonatomic, assign) CGFloat borderBottomWidth;
99@property (nonatomic, assign) CGFloat borderLeftWidth;
100@property (nonatomic, assign) CGFloat borderStartWidth;
101@property (nonatomic, assign) CGFloat borderEndWidth;
102@property (nonatomic, assign) CGFloat borderWidth;
103
104/**
105 * Border styles.
106 */
107@property (nonatomic, assign) RCTBorderStyle borderStyle;
108
109/**
110 * Insets used when hit testing inside this view.
111 */
112@property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets;
113
114@end