Ver Fonte

PDFTools(iOS) - arrow注释UI以及交互

yangliuhua há 1 ano atrás
pai
commit
a72de8db0e
16 ficheiros alterados com 483 adições e 2 exclusões
  1. 28 0
      compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj
  2. 43 1
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m
  3. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/CPDFShapeArrowImageEnd.imageset/Contents.json
  4. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/CPDFShapeArrowImageEnd.imageset/iconmonstr-arrow-right-lined.svg
  5. 21 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/CPDFShapeArrowImageStart.imageset/Contents.json
  6. 1 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/CPDFShapeArrowImageStart.imageset/iconmonstr-arrow-left-lined.svg
  7. 6 0
      compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/Contents.json
  8. 9 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m
  9. 22 1
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m
  10. 25 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleCell.h
  11. 33 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleCell.m
  12. 29 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.h
  13. 95 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.m
  14. 2 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.m
  15. 32 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.h
  16. 115 0
      compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.m

+ 28 - 0
compdfkit-tools/compdfkit-tools.xcodeproj/project.pbxproj

@@ -50,6 +50,13 @@
 		C918CED129FA490000D43974 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C918CED029FA490000D43974 /* Image.xcassets */; };
 		C918CED429FA972300D43974 /* CPDFShapeArrowViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CED229FA972300D43974 /* CPDFShapeArrowViewController.h */; };
 		C918CED529FA972300D43974 /* CPDFShapeArrowViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CED329FA972300D43974 /* CPDFShapeArrowViewController.m */; };
+		C918CED829FB5ADF00D43974 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C918CED729FB5ADF00D43974 /* Image.xcassets */; };
+		C918CEDB29FB73C800D43974 /* CPDFArrowStyleView.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CED929FB73C700D43974 /* CPDFArrowStyleView.h */; };
+		C918CEDC29FB73C800D43974 /* CPDFArrowStyleView.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CEDA29FB73C700D43974 /* CPDFArrowStyleView.m */; };
+		C918CEDF29FB943400D43974 /* CPDFArrowStyleCell.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CEDD29FB943400D43974 /* CPDFArrowStyleCell.h */; };
+		C918CEE029FB943400D43974 /* CPDFArrowStyleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CEDE29FB943400D43974 /* CPDFArrowStyleCell.m */; };
+		C918CEE329FBA41A00D43974 /* CPDFDrawArrowView.h in Headers */ = {isa = PBXBuildFile; fileRef = C918CEE129FBA41A00D43974 /* CPDFDrawArrowView.h */; };
+		C918CEE429FBA41A00D43974 /* CPDFDrawArrowView.m in Sources */ = {isa = PBXBuildFile; fileRef = C918CEE229FBA41A00D43974 /* CPDFDrawArrowView.m */; };
 		C9AF182629EE8AB600EC4979 /* UtilsColor.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */; };
 		C9AF182C29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = C9AF182A29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h */; };
 		C9AF182D29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C9AF182B29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m */; };
@@ -185,6 +192,13 @@
 		C918CED229FA972300D43974 /* CPDFShapeArrowViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFShapeArrowViewController.h; sourceTree = "<group>"; };
 		C918CED329FA972300D43974 /* CPDFShapeArrowViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFShapeArrowViewController.m; sourceTree = "<group>"; };
 		C918CED629FA9B0B00D43974 /* CPDFShareCircleViewController_Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFShareCircleViewController_Header.h; sourceTree = "<group>"; };
+		C918CED729FB5ADF00D43974 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
+		C918CED929FB73C700D43974 /* CPDFArrowStyleView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFArrowStyleView.h; sourceTree = "<group>"; };
+		C918CEDA29FB73C700D43974 /* CPDFArrowStyleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFArrowStyleView.m; sourceTree = "<group>"; };
+		C918CEDD29FB943400D43974 /* CPDFArrowStyleCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFArrowStyleCell.h; sourceTree = "<group>"; };
+		C918CEDE29FB943400D43974 /* CPDFArrowStyleCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFArrowStyleCell.m; sourceTree = "<group>"; };
+		C918CEE129FBA41A00D43974 /* CPDFDrawArrowView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFDrawArrowView.h; sourceTree = "<group>"; };
+		C918CEE229FBA41A00D43974 /* CPDFDrawArrowView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFDrawArrowView.m; sourceTree = "<group>"; };
 		C9AF182529EE8AB600EC4979 /* UtilsColor.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = UtilsColor.xcassets; sourceTree = "<group>"; };
 		C9AF182A29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPDFBookmarkViewCell.h; sourceTree = "<group>"; };
 		C9AF182B29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPDFBookmarkViewCell.m; sourceTree = "<group>"; };
@@ -408,6 +422,7 @@
 				C918CED629FA9B0B00D43974 /* CPDFShareCircleViewController_Header.h */,
 				C918CED229FA972300D43974 /* CPDFShapeArrowViewController.h */,
 				C918CED329FA972300D43974 /* CPDFShapeArrowViewController.m */,
+				C918CED729FB5ADF00D43974 /* Image.xcassets */,
 			);
 			path = PDFShape;
 			sourceTree = "<group>";
@@ -504,6 +519,12 @@
 				C9B9EC4929F4DC8900C6A5D2 /* CPDFThicknessSliderView.m */,
 				C918CE7F29F621E200D43974 /* CPDFColorPickerView.h */,
 				C918CE8029F621E200D43974 /* CPDFColorPickerView.m */,
+				C918CED929FB73C700D43974 /* CPDFArrowStyleView.h */,
+				C918CEDA29FB73C700D43974 /* CPDFArrowStyleView.m */,
+				C918CEDD29FB943400D43974 /* CPDFArrowStyleCell.h */,
+				C918CEDE29FB943400D43974 /* CPDFArrowStyleCell.m */,
+				C918CEE129FBA41A00D43974 /* CPDFDrawArrowView.h */,
+				C918CEE229FBA41A00D43974 /* CPDFDrawArrowView.m */,
 				C918CE8329F62D6F00D43974 /* Image.xcassets */,
 			);
 			path = PDFProperties;
@@ -799,6 +820,7 @@
 				F32DA17429ED904300E19ECA /* CPDFInfoViewController.h in Headers */,
 				C918CE9629F8BA6200D43974 /* CPDFNoteViewController.h in Headers */,
 				C9AF189229F4D0F300EC4979 /* CPDFAnnotationSampleView.h in Headers */,
+				C918CEE329FBA41A00D43974 /* CPDFDrawArrowView.h in Headers */,
 				4F06AB5429F6792E007797E4 /* CPDFTextProperty.h in Headers */,
 				F382636B29EFD0D9003F1DFD /* CPDFSlider.h in Headers */,
 				C918CEA529F8FC1800D43974 /* CPDFUnderlineViewController.h in Headers */,
@@ -817,6 +839,7 @@
 				F32DA16C29ED904300E19ECA /* CPDFSearchResultsViewController.h in Headers */,
 				F382636829EFD0D9003F1DFD /* CPDFPageIndicatorView.h in Headers */,
 				C9B9EC4A29F4DC8900C6A5D2 /* CPDFThicknessSliderView.h in Headers */,
+				C918CEDB29FB73C800D43974 /* CPDFArrowStyleView.h in Headers */,
 				C9AF182C29EFB1FC00EC4979 /* CPDFBookmarkViewCell.h in Headers */,
 				4F1131AF29F8EEA800950564 /* CPDFEditViewController.h in Headers */,
 				F32DA16529ED904300E19ECA /* CPDFOutlineViewController.h in Headers */,
@@ -826,6 +849,7 @@
 				C9AF189B29F4DBF800EC4979 /* CPDFOpacitySliderView.h in Headers */,
 				C918CE9229F7C3FB00D43974 /* CAnnotationManage.h in Headers */,
 				4F1131B429F90E7200950564 /* CPDFImagePropertyCell.h in Headers */,
+				C918CEDF29FB943400D43974 /* CPDFArrowStyleCell.h in Headers */,
 				F32DA17829ED904300E19ECA /* CPDFDisplayTableViewCell.h in Headers */,
 				C9B9EC4E29F52DBF00C6A5D2 /* AAPLCustomPresentationController.h in Headers */,
 				F32DA17129ED904300E19ECA /* CPDFThumbnailViewController.h in Headers */,
@@ -909,6 +933,7 @@
 				C9AF182629EE8AB600EC4979 /* UtilsColor.xcassets in Resources */,
 				4F1131BE29F9232300950564 /* CPDFEditImageAssets.xcassets in Resources */,
 				4F1131BC29F911A800950564 /* CPDFTextPropertyCell.xib in Resources */,
+				C918CED829FB5ADF00D43974 /* Image.xcassets in Resources */,
 				F382636C29EFD0D9003F1DFD /* CPDFSliderImage.xcassets in Resources */,
 				4F1131B629F90E7200950564 /* CPDFImagePropertyCell.xib in Resources */,
 			);
@@ -931,9 +956,11 @@
 				F382636D29EFD0D9003F1DFD /* CPDFListView.m in Sources */,
 				C9AF184229F22BBD00EC4979 /* CPDFAnnotationBarButton.m in Sources */,
 				F32DA17329ED904300E19ECA /* CPDFThumbnailViewController.m in Sources */,
+				C918CEDC29FB73C800D43974 /* CPDFArrowStyleView.m in Sources */,
 				C9B9EC4B29F4DC8900C6A5D2 /* CPDFThicknessSliderView.m in Sources */,
 				C9B9EC5A29F54E9600C6A5D2 /* CAnnotStyle.m in Sources */,
 				C918CEA629F8FC1800D43974 /* CPDFUnderlineViewController.m in Sources */,
+				C918CEE429FBA41A00D43974 /* CPDFDrawArrowView.m in Sources */,
 				F32DA16929ED904300E19ECA /* CPDFSearchResultsViewController.m in Sources */,
 				F32DA16D29ED904300E19ECA /* CPDFSearchViewCell.m in Sources */,
 				F32DA16429ED904300E19ECA /* CPDFOutlineViewCell.m in Sources */,
@@ -968,6 +995,7 @@
 				C918CE8229F621E200D43974 /* CPDFColorPickerView.m in Sources */,
 				F32DA17629ED904300E19ECA /* CPDFInfoViewController.m in Sources */,
 				C918CE9C29F8EE7200D43974 /* CPDFHighlightViewController.m in Sources */,
+				C918CEE029FB943400D43974 /* CPDFArrowStyleCell.m in Sources */,
 				C9AF189829F4DA6A00EC4979 /* CPDFColorSelectView.m in Sources */,
 				C9AF182D29EFB1FC00EC4979 /* CPDFBookmarkViewCell.m in Sources */,
 				C9AF188F29F4C8A900EC4979 /* CPDFAnnotationBaseViewController.m in Sources */,

+ 43 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/CPDFShapeArrowViewController.m

@@ -12,6 +12,7 @@
 
 #import "CPDFShapeArrowViewController.h"
 #import "CPDFShareCircleViewController_Header.h"
+#import "CPDFArrowStyleView.h"
 
 @interface CPDFShapeArrowViewController ()
 
@@ -19,7 +20,7 @@
 
 @property (nonatomic, strong) UIButton *arrowBtn;
 
-@property (nonatomic, strong) UILabel *trialLabe;
+@property (nonatomic, strong) UILabel *trialLabel;
 
 @property (nonatomic, strong) UIButton *trialBtn;
 
@@ -27,14 +28,55 @@
 
 @implementation CPDFShapeArrowViewController
 
+#pragma mark - ViewController Methods
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
+    self.arrowLabel = [[UILabel alloc] init];
+    self.arrowLabel.text = @"Start";
+    [self.view addSubview:self.arrowLabel];
+    
+    self.arrowBtn = [[UIButton alloc] init];
+    [self.arrowBtn setImage:[UIImage imageNamed:@"CPDFShapeArrowImageStart" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    self.arrowBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    [self.arrowBtn addTarget:self action:@selector(buttonItemClicked_start:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:self.arrowBtn];
+    
+    self.trialLabel = [[UILabel alloc] init];
+    self.trialLabel.text = @"End";
+    self.trialLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
+    [self.view addSubview:self.trialLabel];
     
+    self.trialBtn = [[UIButton alloc] init];
+    [self.trialBtn setImage:[UIImage imageNamed:@"CPDFShapeArrowImageEnd" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    self.trialBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+    [self.view addSubview:self.trialBtn];
+}
+
+- (void)viewWillLayoutSubviews {
+    [super viewWillLayoutSubviews];
+    self.arrowLabel.frame = CGRectMake(15, 630, 60, 45);
+    self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 75, 630, 60, 45);
+    self.trialLabel.frame = CGRectMake(15, 675, 60, 45);
+    self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 75, 675, 60, 45);
 }
 
 - (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
     self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 370 : 760);
 }
 
+#pragma mark - Action
+
+- (void)buttonItemClicked_start:(id)sender {
+    CPDFArrowStyleView *arrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:@"Arrow Style"];
+    arrowStyleView.frame = self.view.frame;
+    arrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [self.view addSubview:arrowStyleView];
+}
+
+- (void)buttonItemClicked_trial:(id)sender {
+    
+}
+
 @end

+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/CPDFShapeArrowImageEnd.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "iconmonstr-arrow-right-lined.svg",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/CPDFShapeArrowImageEnd.imageset/iconmonstr-arrow-right-lined.svg


+ 21 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/CPDFShapeArrowImageStart.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "iconmonstr-arrow-left-lined.svg",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/CPDFShapeArrowImageStart.imageset/iconmonstr-arrow-left-lined.svg


+ 6 - 0
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFShape/Image.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 9 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -18,6 +18,7 @@
 #import "CPDFSquigglyViewController.h"
 #import "CPDFInkViewController.h"
 #import "CPDFShapeCircleViewController.h"
+#import "CPDFShapeArrowViewController.h"
 #import "CAnnotStyle.h"
 #import "CPDFListView.h"
 #import "CAnnotationManage.h"
@@ -321,6 +322,14 @@
             [self.parentVC presentViewController:circleVC animated:YES completion:nil];
         }
             break;
+        case CPDFToolbarShapeArrow:
+        {
+            CPDFShapeArrowViewController *arrowVC = [[CPDFShapeArrowViewController alloc] initWithStyle:annotStytle selectIndex:CPDFToolbarShapeArrow title:@"Arrow"];
+            presentationController = [[AAPLCustomPresentationController alloc] initWithPresentedViewController:arrowVC presentingViewController:self.parentVC];
+            arrowVC.transitioningDelegate = presentationController;
+            [self.parentVC presentViewController:arrowVC animated:YES completion:nil];
+        }
+            break;
         default:
             break;
     }

+ 22 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFAnnotationSampleView.m

@@ -18,7 +18,7 @@
 
 @property (nonatomic, assign) CGRect centerRect;
 
-@property (nonatomic, assign) CGRect rectangleRect;
+@property (nonatomic, assign) CGRect arrowRect;
 
 @end
 
@@ -37,6 +37,7 @@
     [super drawRect:rect];
     CGContextRef context = UIGraphicsGetCurrentContext();
     self.centerRect = CGRectInset(rect, 130, 40);
+    self.arrowRect = CGRectInset(rect, 100, 20);
     
     [self drawSamples:context];
 }
@@ -153,6 +154,26 @@
             CGContextFillRect(context, self.centerRect);
         }
             break;
+        case CPDFSamplesShapeArrow:
+        {
+            CGContextSetStrokeColorWithColor(context, self.fillColor.CGColor);
+            if (self.thickness) {
+                CGContextSetLineWidth(context, self.thickness);
+            } else {
+                CGFloat dashLengths[2] = {6, 2};
+                CGContextSetLineDash(context, 0, dashLengths, 2);
+                CGContextSetLineWidth(context, self.dotted);
+            }
+            CGContextMoveToPoint(context, CGRectGetMinX(self.arrowRect), CGRectGetMaxY(self.arrowRect));
+            CGContextAddLineToPoint(context, CGRectGetMaxX(self.arrowRect), CGRectGetMinY(self.arrowRect));
+            
+            CGContextMoveToPoint(context, CGRectGetMaxX(self.arrowRect) - 20, CGRectGetMinY(self.arrowRect));
+            CGContextAddLineToPoint(context, CGRectGetMaxX(self.arrowRect), CGRectGetMinY(self.arrowRect));
+            CGContextAddLineToPoint(context, CGRectGetMaxX(self.arrowRect), CGRectGetMinY(self.arrowRect) + 20);
+            
+            CGContextStrokePath(context);
+        }
+            break;
         default:
             break;
     }

+ 25 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleCell.h

@@ -0,0 +1,25 @@
+//
+//  CPDFArrowStyleCell.h
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class CPDFDrawArrowView;
+
+@interface CPDFArrowStyleCell : UICollectionViewCell
+
+@property (nonatomic, strong) CPDFDrawArrowView *contextView;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 33 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleCell.m

@@ -0,0 +1,33 @@
+//
+//  CPDFArrowStyleCell.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CPDFArrowStyleCell.h"
+#import "CPDFDrawArrowView.h"
+
+@implementation CPDFArrowStyleCell
+
+#pragma mark - Initializers
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.contextView = [[CPDFDrawArrowView alloc] initWithSelectIndex:1];
+        self.contextView.layer.borderWidth = 1.0;
+        self.contextView.layer.borderColor = [UIColor purpleColor].CGColor;
+        self.contextView.backgroundColor = [UIColor whiteColor];
+        self.contextView.frame = self.frame;
+//        [self.contextView ];
+        [self.contentView addSubview:self.contextView];
+    }
+    return self;
+}
+
+@end

+ 29 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.h

@@ -0,0 +1,29 @@
+//
+//  CPDFArrowStyleView.h
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CPDFArrowStyleView : UIView
+
+@property (nonatomic, strong) UIButton *backBtn;
+
+@property (nonatomic, strong) UILabel *titleLabel;
+
+@property (nonatomic, strong) UICollectionView *collectView;
+
+- (instancetype)initWirhTitle:(NSString *)title;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 95 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFArrowStyleView.m

@@ -0,0 +1,95 @@
+//
+//  CPDFArrowStyleView.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CPDFArrowStyleView.h"
+#import "CPDFArrowStyleCell.h"
+#import "CPDFDrawArrowView.h"
+
+@interface CPDFArrowStyleView () <UICollectionViewDelegate,UICollectionViewDataSource>
+
+@property (nonatomic, strong) NSArray *dataArray;
+
+@end
+
+@implementation CPDFArrowStyleView
+
+#pragma mark - Accessors
+
+//- (NSArray *)dataArray {
+//    if (!_dataArray) {
+//        NSMutableArray *dataArray = [NSMutableArray array];
+//        for (NSInteger i = 0; i < 6; i++) {
+//            CPDFDrawArrowView *arrowView = [[CPDFDrawArrowView alloc] initWithSelectIndex:i];
+//            arrowView.backgroundColor = [UIColor redColor];
+//            [dataArray addObject:arrowView];
+//        }
+//        self.dataArray = dataArray;
+//    }
+//    return _dataArray;
+//}
+
+#pragma mark - Initializers
+
+- (instancetype)initWirhTitle:(NSString *)title {
+    if (self = [super init]) {
+        self.backBtn = [[UIButton alloc] init];
+        [self.backBtn setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+        [self.backBtn addTarget:self action:@selector(buttonItemClicked_back:) forControlEvents:UIControlEventTouchUpInside];
+        [self addSubview:self.backBtn];
+        
+        self.titleLabel = [[UILabel alloc] init];
+        self.titleLabel.text = NSLocalizedString(title, nil);
+        [self addSubview:self.titleLabel];
+        
+        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
+        layout.itemSize = CGSizeMake(110, 50);
+        layout.sectionInset = UIEdgeInsetsMake(5, 5, 5, 5);
+        layout.minimumInteritemSpacing = 5;
+        layout.minimumLineSpacing = 5;
+        self.collectView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 50, self.frame.size.width, self.frame.size.height) collectionViewLayout:layout];
+        [self.collectView registerClass:[CPDFArrowStyleCell class] forCellWithReuseIdentifier:@"cell"];
+        self.collectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        self.collectView.delegate = self;
+        self.collectView.dataSource = self;
+        [self addSubview:self.collectView];
+        
+        self.backgroundColor = [UIColor whiteColor];
+    }
+    return self;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    self.backBtn.frame = CGRectMake(15, 5, 60, 50);
+    self.titleLabel.frame = CGRectMake((self.frame.size.width - 100)/2, 5, 100, 50);
+//    self.collectView.frame = ;
+}
+
+#pragma mark - Action
+
+- (void)buttonItemClicked_back:(id)sender {
+    
+}
+
+#pragma mark - UICollectionViewDataSource
+
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
+    return 6;
+}
+
+- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
+    CPDFArrowStyleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
+//    cell.contextView = self.dataArray[indexPath.item];
+    return cell;
+}
+
+@end

+ 2 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorPickerView.m

@@ -35,6 +35,8 @@
 
 @implementation CPDFColorPickerView
 
+#pragma mark - Initializers
+
 - (instancetype)initWithFrame:(CGRect)frame {
     if (self == [super initWithFrame:frame]) {
         _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.frame.size.width - 120)/2, 0, 120, (self.bounds.size.height - 40)/6)];

+ 32 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.h

@@ -0,0 +1,32 @@
+//
+//  CPDFDrawArrowView.h
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef NS_ENUM(NSInteger, CPDFDrawSelectedIndex) {
+    CPDFDrawNone = 0,
+    CPDFDrawArrow,
+    CPDFDrawTriangle,
+    CPDFDrawSquare,
+    CPDFDrawCircle,
+    CPDFDrawDiamond
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CPDFDrawArrowView : UIView
+
+- (instancetype)initWithSelectIndex:(CPDFDrawSelectedIndex)selectIndex;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 115 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFDrawArrowView.m

@@ -0,0 +1,115 @@
+//
+//  CPDFDrawArrowView.m
+//  compdfkit-tools
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import "CPDFDrawArrowView.h"
+
+@interface CPDFDrawArrowView ()
+
+@property (nonatomic, assign) CPDFDrawSelectedIndex selectIndex;
+
+@end
+
+@implementation CPDFDrawArrowView
+
+- (instancetype)initWithSelectIndex:(CPDFDrawSelectedIndex)selectIndex {
+    if (self = [super init]) {
+        self.selectIndex = selectIndex;
+    }
+    return self;
+}
+
+- (void)drawRect:(CGRect)rect {
+    [super drawRect:rect];
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    CGPoint start = CGPointMake(CGRectGetMinX(rect), CGRectGetMidY(rect));
+    CGPoint end = CGPointMake(CGRectGetMaxX(rect), CGRectGetMidY(rect));
+    [self drawArrow:context startPoint:start endPoint:end];
+}
+
+#pragma mark - Private Methods
+
+- (void)drawArrow:(CGContextRef)context startPoint:(CGPoint)start endPoint:(CGPoint)end {
+    CGContextSetStrokeColorWithColor(context, [UIColor blackColor].CGColor);
+    CGContextSetLineWidth(context, 2);
+    switch (self.selectIndex) {
+        case CPDFDrawNone:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
+        }
+            break;
+        case CPDFDrawArrow:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            
+            CGContextMoveToPoint(context, end.x-5, end.y-5);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x+5, end.y+5);
+            CGContextStrokePath(context);
+        }
+            break;
+        case CPDFDrawTriangle:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
+            
+            CGContextMoveToPoint(context, end.x-5, end.y-5);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x+5, end.y+5);
+            CGContextFillPath(context);
+        }
+            break;
+        case CPDFDrawSquare:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
+            
+            CGContextMoveToPoint(context, end.x-10, end.y);
+            CGContextAddLineToPoint(context, end.x - 5, end.y - 5);
+            CGContextAddLineToPoint(context, end.x + 5, end.y + 5);
+            CGContextAddLineToPoint(context, end.x, end.y+10);
+            CGContextFillPath(context);
+        }
+            break;
+        case CPDFDrawCircle:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
+            
+            CGContextAddArc(context, end.x, end.y, 10, 0, 2*3.14159265358979323846, 0);
+            CGContextDrawPath(context, kCGPathStroke);
+        }
+            break;
+        case CPDFDrawDiamond:
+        {
+            CGContextMoveToPoint(context, start.x, start.y);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextStrokePath(context);
+            
+            CGContextMoveToPoint(context, end.x-5, end.y-5);
+            CGContextAddLineToPoint(context, end.x, end.y);
+            CGContextAddLineToPoint(context, end.x+5, end.y+5);
+            CGContextAddLineToPoint(context, end.x-10, end.y+10);
+            CGContextFillPath(context);
+        }
+            break;
+        default:
+            break;
+    }
+}
+
+@end