@applicaster/quick-brick-native-apple 5.22.0 → 5.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "QuickBrickApple",
3
- "version": "5.22.0",
3
+ "version": "5.22.1",
4
4
  "platforms": {
5
5
  "ios": "14.0",
6
6
  "tvos": "14.0"
@@ -16,7 +16,7 @@
16
16
  "authors": "Applicaster LTD.",
17
17
  "source": {
18
18
  "git": "https://github.com/applicaster/Zapp-Frameworks.git",
19
- "tag": "@@applicaster/quick-brick-native-apple/5.22.0"
19
+ "tag": "@@applicaster/quick-brick-native-apple/5.22.1"
20
20
  },
21
21
  "requires_arc": true,
22
22
  "source_files": "universal/**/*.{m,swift}",
@@ -71,18 +71,35 @@ class QuickBrickViewController: UIViewController, UILayerViewControllerProtocol
71
71
  forceOrientationWithMaskIfNeeded(orientationMask)
72
72
  }
73
73
 
74
+ override func viewDidLayoutSubviews() {
75
+ super.viewDidLayoutSubviews()
76
+
77
+ // viewWillTransition not is not reliable, so we have to use viewDidLayoutSubviews instead
78
+ // In some cases viewWillTransition may not be called
79
+ callManuallyTrackWillTransitionEvent(to: view.bounds.size)
80
+ }
81
+
74
82
  override func viewWillTransition(to size: CGSize,
75
83
  with coordinator: UIViewControllerTransitionCoordinator) {
76
84
  super.viewWillTransition(to: size, with: coordinator)
85
+
86
+ callManuallyTrackWillTransitionEvent(to: size)
87
+ }
88
+
89
+ private func callManuallyTrackWillTransitionEvent(to size: CGSize) {
77
90
  let isLandscape = size.width > size.height
78
91
  let interfaceOrientation = isLandscape ?
79
92
  UIInterfaceOrientation.landscapeLeft :
80
93
  UIInterfaceOrientation.portrait
81
94
 
95
+ guard interfaceOrientation != currentInterfaceOrientation else {
96
+ return
97
+ }
98
+
82
99
  let reactNativeToOrientation = ReactNativeOrientation.fromInterfaceOrientation(orientation: interfaceOrientation)
83
100
  let reactNativefromOrientation = ReactNativeOrientation.fromInterfaceOrientation(orientation: currentInterfaceOrientation)
84
- currentInterfaceOrientation = interfaceOrientation
85
101
 
102
+ currentInterfaceOrientation = interfaceOrientation
86
103
  ReactNativeEventEmitter.orientationChange(toOrientation: reactNativeToOrientation,
87
104
  fromOrientation: reactNativefromOrientation)
88
105
 
@@ -131,7 +148,6 @@ class QuickBrickViewController: UIViewController, UILayerViewControllerProtocol
131
148
  ReactNativeEventEmitter.orientationChange(toOrientation: reactNativeToOrientation,
132
149
  fromOrientation: reactNativeFromOrientation,
133
150
  physicalChange: true)
134
-
135
151
  logger?.debugLog(message: "deviceDidRotate: device oritation changed to: \(deviceOrientation.toString())",
136
152
  category: QuickBrickViewControllerLogs.forceOrientation.category)
137
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-native-apple",
3
- "version": "5.22.0",
3
+ "version": "5.22.1",
4
4
  "description": "iOS and tvOS native code for QuickBrick applications. This package is used to provide native logic for QuickBrick",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"