Skip to content

Commit d24c280

Browse files
authored
Merge pull request #8 from loijwdev/feat/ios-old-arch-support
feat(ios): add Old Architecture support via LiveDetectEdgesViewManager
2 parents a6f0860 + e3d302d commit d24c280

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PODS:
88
- hermes-engine (0.14.0):
99
- hermes-engine/Pre-built (= 0.14.0)
1010
- hermes-engine/Pre-built (0.14.0)
11-
- LiveDetectEdges (0.1.0):
11+
- LiveDetectEdges (0.2.0):
1212
- boost
1313
- DoubleConversion
1414
- fast_float
@@ -3163,7 +3163,7 @@ SPEC CHECKSUMS:
31633163
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
31643164
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
31653165
hermes-engine: aac92a2a793919da02683c1c2b6d9eabf622619c
3166-
LiveDetectEdges: c6114eee4705426f76a642f73e7aa7b2fa5971e2
3166+
LiveDetectEdges: 836a297097894fb04fd9353defa0e1c6d0d9c6fa
31673167
RCT-Folly: 59ec0ac1f2f39672a0c6e6cecdd39383b764646f
31683168
RCTDeprecation: 2b70c6e3abe00396cefd8913efbf6a2db01a2b36
31693169
RCTRequired: f3540eee8094231581d40c5c6d41b0f170237a81

example/src/screens/HomeScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import {
77
Platform,
88
ActivityIndicator,
99
Button,
10-
SafeAreaView,
1110
Alert,
1211
} from 'react-native';
1312
import { LiveDetectEdgesView, takePhoto } from 'react-native-live-detect-edges';
1413
import { useNavigation } from '@react-navigation/native';
14+
import { SafeAreaView } from 'react-native-safe-area-context';
1515
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
1616
import type { RootStackParamList } from '../navigation/types';
1717

ios/LiveDetectEdgesViewManager.mm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# import <React/RCTViewManager.h>
2+
# import "LiveDetectEdges-Swift.h" // Import Swift header
3+
4+
@interface LiveDetectEdgesViewManager : RCTViewManager
5+
@end
6+
7+
@implementation LiveDetectEdgesViewManager
8+
9+
RCT_EXPORT_MODULE(LiveDetectEdgesView)
10+
11+
- (UIView *)view
12+
{
13+
return [[LiveDetectEdgesScannerWrapper alloc] init];
14+
}
15+
16+
RCT_EXPORT_VIEW_PROPERTY(overlayColor, UIColor)
17+
RCT_EXPORT_VIEW_PROPERTY(overlayFillColor, UIColor)
18+
RCT_EXPORT_VIEW_PROPERTY(overlayStrokeWidth, CGFloat)
19+
20+
@end

0 commit comments

Comments
 (0)