File tree Expand file tree Collapse file tree
ios/ReactNativePdfRendererLibrary Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ require 'json'
33packageJson = JSON . parse ( File . read ( 'package.json' ) )
44version = packageJson [ "version" ]
55repository = packageJson [ "repository" ] [ "url" ]
6+ fabric_enabled = ENV [ 'RCT_NEW_ARCH_ENABLED' ] == '1'
67
78Pod ::Spec . new do |s |
89 s . name = "ReactNativePdfRenderer"
@@ -19,5 +20,9 @@ Pod::Spec.new do |s|
1920
2021 s . frameworks = 'PDFKit'
2122
22- install_modules_dependencies ( s )
23+ if fabric_enabled
24+ install_modules_dependencies ( s )
25+ else
26+ s . dependency "React-Core"
27+ end
2328end
Original file line number Diff line number Diff line change @@ -29,16 +29,13 @@ @implementation RNPDFView
2929
3030-(void ) setParams : (NSDictionary *) params {
3131 NSString *source = [params objectForKey: @" source" ];
32+ NSString *maxZoomString = [params objectForKey: @" maxZoom" ];
33+ NSString *singlePageString = [params objectForKey: @" singlePage" ];
3234
33- float maxZoom = [params objectForKey: @" maxZoom" ] != nil
34- ? [[params objectForKey: @" maxZoom" ] floatValue ]
35- : 0 ;
36-
37- BOOL singlePage = [params objectForKey: @" singlePage" ] != nil
38- ? [[params objectForKey: @" singlePage" ] boolValue ]
39- : NO ;
40-
41- if ([params objectForKey: @" source" ] != nil ) {
35+ if (source != nil ) {
36+ float maxZoom = maxZoomString != nil ? [maxZoomString floatValue ] : 0 ;
37+ BOOL singlePage = singlePageString != nil ? [singlePageString boolValue ] : NO ;
38+
4239 if (![source hasPrefix: @" file://" ]) {
4340 source = [NSString stringWithFormat: @" %@%@ " , @" file://" , source];
4441 }
Original file line number Diff line number Diff line change @@ -46,6 +46,14 @@ - (UIView *)view
4646 return view;
4747}
4848
49+ - (void )dealloc
50+ {
51+ if (observerAdded) {
52+ observerAdded = NO ;
53+ [NSNotificationCenter .defaultCenter removeObserver: self name: PDFViewPageChangedNotification object: nil ];
54+ }
55+ }
56+
4957- (void )handlePageChange : (NSNotification *) notification {
5058 if ([RNPDFView class ] != [notification.object class ]) {
5159 return ;
You can’t perform that action at this time.
0 commit comments