3 コミット d87a3e1174 ... 7685260d1b

作者 SHA1 メッセージ 日付
  dengkang 7685260d1b Merge branch 'ios' into ios_dengkang 2 年 前
  yangliuhua 2567a28e17 PDFView(ios) - 添加菜单 2 年 前
  yangliuhua 9fae29b1aa PDFView(ios) - 添加菜单 2 年 前

+ 12 - 1
PDFViewer.xcodeproj/project.pbxproj

@@ -7,6 +7,7 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		C96D13932924793800CC92C7 /* btn_more.png in Resources */ = {isa = PBXBuildFile; fileRef = C96D13922924793800CC92C7 /* btn_more.png */; };
 		EC3198782922593A008E0889 /* ComPDFKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC31987629225931008E0889 /* ComPDFKit.framework */; };
 		EC3198792922593A008E0889 /* ComPDFKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EC31987629225931008E0889 /* ComPDFKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		EC62978E29220F8300D339EE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EC62978D29220F8300D339EE /* AppDelegate.m */; };
@@ -39,6 +40,7 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+		C96D13922924793800CC92C7 /* btn_more.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_more.png; sourceTree = "<group>"; };
 		EC31987629225931008E0889 /* ComPDFKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ComPDFKit.framework; sourceTree = "<group>"; };
 		EC62978929220F8300D339EE /* PDFViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PDFViewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		EC62978C29220F8300D339EE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -77,6 +79,14 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		C96D13912924791E00CC92C7 /* Images */ = {
+			isa = PBXGroup;
+			children = (
+				C96D13922924793800CC92C7 /* btn_more.png */,
+			);
+			path = Images;
+			sourceTree = "<group>";
+		};
 		EC62978029220F8300D339EE = {
 			isa = PBXGroup;
 			children = (
@@ -137,6 +147,7 @@
 		EC6297B52922393F00D339EE /* Controller */ = {
 			isa = PBXGroup;
 			children = (
+				C96D13912924791E00CC92C7 /* Images */,
 				EC6297BB292239C200D339EE /* CPDFListController.h */,
 				EC6297BC292239C200D339EE /* CPDFListController.m */,
 				ECC8831B2923352B00F6392E /* CPDFViewController.h */,
@@ -205,7 +216,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				EC62979C29220F8400D339EE /* LaunchScreen.storyboard in Resources */,
-				ECE319742924849C00DB9D2F /* pdfImage@2x.png in Resources */,
+				C96D13932924793800CC92C7 /* btn_more.png in Resources */,
 				EC62979929220F8400D339EE /* Assets.xcassets in Resources */,
 				EC62979729220F8300D339EE /* Main.storyboard in Resources */,
 			);

BIN
PDFViewer.xcodeproj/project.xcworkspace/xcuserdata/kdan.xcuserdatad/UserInterfaceState.xcuserstate


+ 27 - 3
PDFViewer/Controller/CPDFViewController.m

@@ -8,9 +8,10 @@
 
 #import <ComPDFKit/ComPDFKit.h>
 #import <ComPDFKit/CPDFWatermark.h>
+#import <ComPDFKit/CPDFHeaderFooter.h>
 #import "CPDFViewController.h"
 
-@interface CPDFViewController ()
+@interface CPDFViewController () <UIActionSheetDelegate>
 
 @end
 
@@ -26,13 +27,36 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
+    //add UIBarButtonItem in Navigation
+    self.navigationController.toolbarHidden = NO;
+    UIImage *btnMore = [UIImage imageNamed:@"btn_more"];
+    UIBarButtonItem *ringhtBarItem = [[UIBarButtonItem alloc] initWithImage:btnMore style:UIBarButtonItemStylePlain target:self action:@selector(onClickedOkbtn)];
+    self.navigationItem.rightBarButtonItem = ringhtBarItem;
+    //setting URL
     NSURL *url = [NSURL fileURLWithPath:_path];
     CPDFDocument *document = [[CPDFDocument alloc] initWithURL:url];
     CPDFView *pdfView = [[CPDFView alloc] initWithFrame:self.view.bounds];
     pdfView.document = document;
     pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.view addSubview:pdfView];
-    
+
+   [self.view addSubview:pdfView];
+}
+
+- (void)onClickedOkbtn {
+    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
+    UIAlertAction *addWatermarkAction = [UIAlertAction actionWithTitle:@"Add Watermark" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            NSLog(@"addWatermarkAction");
+        }];
+    UIAlertAction *addHeaderfooterAction = [UIAlertAction actionWithTitle:@"Add Headerfooter" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            NSLog(@"addHeaderfooterAction");
+        }];
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
+            NSLog(@"Cancel Action");
+        }];
+    [alertController addAction:addWatermarkAction];
+    [alertController addAction:addHeaderfooterAction];
+    [alertController addAction:cancelAction];
+    [self presentViewController:alertController animated:YES completion:nil];
 }
 
 @end

BIN
PDFViewer/Controller/Images/btn_more.png