@@ -26,26 +26,7 @@ class ReactNativeDeviceActivityView: ExpoView {
26
26
27
27
clipsToBounds = true
28
28
29
- // Configure the hosting controller
30
- contentView. view. backgroundColor = . clear
31
- contentView. view. translatesAutoresizingMaskIntoConstraints = false
32
-
33
- // Add the view directly
34
- addSubview ( contentView. view)
35
-
36
- // Setup constraints
37
- NSLayoutConstraint . activate ( [
38
- contentView. view. topAnchor. constraint ( equalTo: topAnchor) ,
39
- contentView. view. leadingAnchor. constraint ( equalTo: leadingAnchor) ,
40
- contentView. view. trailingAnchor. constraint ( equalTo: trailingAnchor) ,
41
- contentView. view. bottomAnchor. constraint ( equalTo: bottomAnchor)
42
- ] )
43
-
44
- // Find root view controller and add content view controller as child
45
- if let rootViewController = UIApplication . shared. windows. first? . rootViewController {
46
- rootViewController. addChild ( contentView)
47
- contentView. didMove ( toParent: rootViewController)
48
- }
29
+ self . addSubview ( contentView. view)
49
30
50
31
model. $activitySelection. debounce ( for: . seconds( 0.1 ) , scheduler: RunLoop . main) . sink {
51
32
selection in
@@ -57,6 +38,10 @@ class ReactNativeDeviceActivityView: ExpoView {
57
38
. store ( in: & cancellables)
58
39
}
59
40
41
+ override func layoutSubviews( ) {
42
+ contentView. view. frame = bounds
43
+ }
44
+
60
45
let onSelectionChange = EventDispatcher ( )
61
46
62
47
var previousSelection : FamilyActivitySelection ?
0 commit comments