Home asdisplaynode-uiviewbridging
Post
Cancel

asdisplaynode-uiviewbridging

ASDisplayNode+UIViewBridge.mm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
- (BOOL)canBecomeFocused;
- (void)setNeedsFocusUpdate;
- (void)updateFocusIfNeeded;
- (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context;
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator;
- (UIView *)preferredFocusedView;
- (BOOL)canBecomeFirstResponder;
- (BOOL)canResignFirstResponder;
- (BOOL)isFirstResponder;
- (BOOL)becomeFirstResponder;
- (BOOL)resignFirstResponder;
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
  ASDisplayNodeAssertMainThread();
  return !self.layerBacked && [self.view canPerformAction:action withSender:sender];
}

- (CGFloat)alpha
{
  _bridge_prologue_read;
  return _getFromViewOrLayer(opacity, alpha);
}

- (CGFloat)cornerRadius;
- (void)setCornerRadius:(CGFloat)newCornerRadius
{
  [self updateCornerRoundingWithType:self.cornerRoundingType cornerRadius:newCornerRadius];
}

- (ASCornerRoundingType)cornerRoundingType;
- (void)setCornerRoundingType:(ASCornerRoundingType)newRoundingType;
  
- (NSString *)contentsGravity
{
  _bridge_prologue_read;
  return _getFromLayer(contentsGravity);
}

- (void)setContentsGravity:(NSString *)newContentsGravity
{
  _bridge_prologue_write;
  _setToLayer(contentsGravity, newContentsGravity);
}

- (CGRect)contentsRect
{
  _bridge_prologue_read;
  return _getFromLayer(contentsRect);
}

- (void)setContentsRect:(CGRect)newContentsRect
{
  _bridge_prologue_write;
  _setToLayer(contentsRect, newContentsRect);
}

- (CGRect)contentsCenter
{
  _bridge_prologue_read;
  return _getFromLayer(contentsCenter);
}

- (void)setContentsCenter:(CGRect)newContentsCenter
{
  _bridge_prologue_write;
  _setToLayer(contentsCenter, newContentsCenter);
}

- (CGFloat)contentsScale
{
  _bridge_prologue_read;
  return _getFromLayer(contentsScale);
}

- (void)setContentsScale:(CGFloat)newContentsScale
{
  _bridge_prologue_write;
  _setToLayer(contentsScale, newContentsScale);
}

- (CGFloat)rasterizationScale
{
  _bridge_prologue_read;
  return _getFromLayer(rasterizationScale);
}

- (void)setRasterizationScale:(CGFloat)newRasterizationScale
{
  _bridge_prologue_write;
  _setToLayer(rasterizationScale, newRasterizationScale);
}

- (CGRect)bounds
{
  _bridge_prologue_read;
  return _getFromViewOrLayer(bounds, bounds);
}

- (void)setBounds:(CGRect)newBounds
{
  _bridge_prologue_write;
  _setToViewOrLayer(bounds, newBounds, bounds, newBounds);
  self.threadSafeBounds = newBounds;
}
  
This post is licensed under CC BY 4.0 by the author.