Browse Source

PDFTools(iOS)-代码整理

dinglingui 1 year ago
parent
commit
9547ec6aa1

+ 2 - 0
ComPDFKit/ComPDFKit.xcodeproj/project.pbxproj

@@ -382,6 +382,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = ComPDFKit/Info.plist;
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@@ -409,6 +410,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = ComPDFKit/Info.plist;
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;

+ 6 - 10
ComPDFKit/ComPDFKit/CPDFViewController.m

@@ -331,6 +331,12 @@
 #pragma mark - CPDFViewDelegate
 
 - (void)PDFViewEditingSelectStateDidChanged:(CPDFView *)pdfView {
+    if([pdfView.editingArea isKindOfClass:[CPDFEditImageArea class]]) {
+        self.editMode = CPDFEditModeImage;
+    }else if([pdfView.editingArea isKindOfClass:[CPDFEditTextArea class]]) {
+        self.editMode  = CPDFEditModeText;
+    }
+    
     [self.toolBar updateButtonState];
 }
 
@@ -491,16 +497,6 @@
     [self.toolBar updateButtonState];
 }
 
-- (void)PDFViewEditingSelectStateDidChanged:(CPDFView *)pdfView {
-    if([pdfView.editingArea isKindOfClass:[CPDFEditImageArea class]]) {
-        self.editMode = CPDFEditModeImage;
-    }else if([pdfView.editingArea isKindOfClass:[CPDFEditTextArea class]]) {
-        self.editMode  = CPDFEditModeText;
-    }
-    
-    [self.toolBar updateButtonState];
-}
-
 #pragma mark - CPDFAnnotationBarDelegate
 
 - (void)annotationBarClick:(CPDFAnnotationBar *)annotationBar clickAnnotationMode:(CPDFViewAnnotationMode)annotationMode forSelected:(BOOL)isSelected forButton:(UIButton *)button {

+ 2 - 1
Edit-Ctrl-Demo/Edit-Ctrl-Demo/CPDFViewController.m

@@ -191,7 +191,8 @@
     }
     
     [self.toolBar updateButtonState];
-    
+}
+
 - (void)PDFListViewPerformTouchEnded:(CPDFListView *)pdfView {
     CGFloat tPosY = 0;
     CGFloat tBottomY = 0;

+ 2 - 5
compdfkit-tools/compdfkit-tools/Common/Controls/PDFViewController/CPDFViewBaseController.m

@@ -161,15 +161,12 @@
     self.navigationTitle = NSLocalizedString(@"Viewer", nil);
     [navTitleButton setTitle:self.navigationTitle forState:UIControlStateNormal];
     [navTitleButton setTitleColor:[CPDFColorUtils CAnyReverseBackgooundColor] forState:UIControlStateNormal];
-    self.titleButton.frame = CGRectMake(0, 0, 50, 30);
+    self.titleButton.frame = CGRectMake(0, 0, 100, 30);
     self.navigationItem.titleView = self.titleButton;
 }
 
 - (void)reloadDocumentWithFilePath:(NSString *)filePath password:(nullable NSString *)password completion:(void (^)(BOOL result))completion {
     
-    _navigationTitle = self.title;
-    //
-    [self.titleButton setTitle:self.title forState:UIControlStateNormal];
     [self.navigationController.view setUserInteractionEnabled:NO];
     
     if (![self.loadingView superview]) {
@@ -301,7 +298,7 @@
         
         self.navigationItem.leftBarButtonItem = self.leftBarButtonItem;
     }
-    self.navigationTitle = @"Viewer";
+    self.navigationTitle = NSLocalizedString(@"Viewer",nil);
     self.titleButton.hidden = NO;
 }