From 07f4517d1e2c3fc5ba5ec297372820d97e0fcf7e Mon Sep 17 00:00:00 2001 From: "Scott Corscadden (Morgiij)" Date: Sun, 5 Nov 2017 20:40:04 -0500 Subject: [PATCH 01/15] Make rightBarButtons() a bit more forgiving --- Pod/Classes/Renderer/PDFViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pod/Classes/Renderer/PDFViewController.swift b/Pod/Classes/Renderer/PDFViewController.swift index 3e13528..03b6db2 100644 --- a/Pod/Classes/Renderer/PDFViewController.swift +++ b/Pod/Classes/Renderer/PDFViewController.swift @@ -198,7 +198,7 @@ open class PDFViewController: UIViewController { open func rightBarButtons() -> [UIBarButtonItem] { if (signatureMode) { - var buttons = self.navigationItem.rightBarButtonItems! + var buttons = self.navigationItem.rightBarButtonItems ?? [] // undo button buttons.append(annotationController.undoButton) From c4e24d6c49c0c0f6e04c0deb9b846ecd78d6b28e Mon Sep 17 00:00:00 2001 From: "Scott Corscadden (Morgiij)" Date: Mon, 6 Nov 2017 09:47:51 -0500 Subject: [PATCH 02/15] Fix rightBarButtons() and signatureMode That is, it should not assume that the Pen tool is button index 1. It should find it by type or assert otherwise. --- Pod/Classes/Renderer/PDFViewController.swift | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Pod/Classes/Renderer/PDFViewController.swift b/Pod/Classes/Renderer/PDFViewController.swift index 03b6db2..bd2f4b3 100644 --- a/Pod/Classes/Renderer/PDFViewController.swift +++ b/Pod/Classes/Renderer/PDFViewController.swift @@ -203,8 +203,18 @@ open class PDFViewController: UIViewController { // undo button buttons.append(annotationController.undoButton) - // draw button - buttons.append(annotationController.buttons[1]); + // find the draw button (hopefully you added that thing huh?) + if let penButton = annotationController.buttons.filter({ (button: PDFBarButton) -> Bool in + if let annotationButton = button as? PDFAnnotationBarButton { + return annotationButton.annotationType == PDFPenAnnotation.self + } + return false + }).first { + buttons.append(penButton); + } + else { + assert(false, "Used 'signatureMode' of true, but did NOT provide the PDFPenAnnotationBarButton as an annotation! No Sign button for you!") + } return buttons } From 8f7f06c04bc90988ffa16c1d3ee3fe62c598ff5d Mon Sep 17 00:00:00 2001 From: "Scott Corscadden (Morgiij)" Date: Mon, 6 Nov 2017 10:49:56 -0500 Subject: [PATCH 03/15] Add autoSaveAction lazy closure var customization point That is, when disappearing from the view, the settor of that closure could infer from the passed PDFAnnotationController whether there are things to save, and if so, decide where/what to do or just ignore etc. Default behaviour is as before, just assigns the annotations out of the annotationController to the PDFDocument itself, then call save() on that document to archiveRootObject. --- Pod/Classes/Renderer/PDFViewController.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Pod/Classes/Renderer/PDFViewController.swift b/Pod/Classes/Renderer/PDFViewController.swift index bd2f4b3..20df729 100644 --- a/Pod/Classes/Renderer/PDFViewController.swift +++ b/Pod/Classes/Renderer/PDFViewController.swift @@ -52,6 +52,14 @@ open class PDFViewController: UIViewController { /// The default action brings up a UIActivityViewController open lazy var shareBarButtonAction: () -> () = { self.showActivitySheet() } + /// A closure that defines what happens on viewWillDisappear. + /// The default is to assign the annotations out of the annotationController into + /// the document, then call document.save() + open lazy var autoSaveAction: (PDFDocument, PDFAnnotationController) -> () = { document, annotationController in + document.annotations = annotationController.annotations + document.save() + } + /// A reference to the collection view handling page presentation var collectionView: PDFSinglePageViewer! @@ -160,8 +168,7 @@ open class PDFViewController: UIViewController { super.viewWillDisappear(animated) self.annotationController.finishAnnotation() - self.document.annotations = self.annotationController.annotations - self.document.save() + autoSaveAction(self.document, self.annotationController) } open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { From e8e91aaacc164e592d2adb7418fe0c629bed5ab5 Mon Sep 17 00:00:00 2001 From: "Scott Corscadden (Morgiij)" Date: Mon, 6 Nov 2017 11:11:18 -0500 Subject: [PATCH 04/15] Add readonly access to annotations In PDFAnnotationController, and PDFAnnotationStore --- Pod/Classes/Annotations/PDFAnnotationController.swift | 2 +- Pod/Classes/Annotations/PDFAnnotationStore.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pod/Classes/Annotations/PDFAnnotationController.swift b/Pod/Classes/Annotations/PDFAnnotationController.swift index e0cd2b0..67db72f 100644 --- a/Pod/Classes/Annotations/PDFAnnotationController.swift +++ b/Pod/Classes/Annotations/PDFAnnotationController.swift @@ -18,7 +18,7 @@ open class PDFAnnotationController: UIViewController { var document: PDFDocument! /// Store containing all annotations for document - var annotations = PDFAnnotationStore() + private (set) open var annotations = PDFAnnotationStore() /// References to pages within view var allPages = [PDFPageContentView]() diff --git a/Pod/Classes/Annotations/PDFAnnotationStore.swift b/Pod/Classes/Annotations/PDFAnnotationStore.swift index c35058b..bcf5257 100644 --- a/Pod/Classes/Annotations/PDFAnnotationStore.swift +++ b/Pod/Classes/Annotations/PDFAnnotationStore.swift @@ -17,7 +17,7 @@ public protocol PDFAnnotationStoreDelegate { open class PDFAnnotationStore: NSObject, NSCoding { - var annotations: [PDFAnnotation] = [] + private (set) open var annotations: [PDFAnnotation] = [] var delegate: PDFAnnotationStoreDelegate? From 2e85fb8339f0f6be4f50492e2c6056c0bfc87dbc Mon Sep 17 00:00:00 2001 From: "Scott Corscadden (Morgiij)" Date: Tue, 7 Nov 2017 13:40:43 -0500 Subject: [PATCH 05/15] Work around #76: Don't draw/annotate unless only one finger is used --- .../Annotations/PDFAnnotationController.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Pod/Classes/Annotations/PDFAnnotationController.swift b/Pod/Classes/Annotations/PDFAnnotationController.swift index 67db72f..5397d0b 100644 --- a/Pod/Classes/Annotations/PDFAnnotationController.swift +++ b/Pod/Classes/Annotations/PDFAnnotationController.swift @@ -231,7 +231,13 @@ open class PDFAnnotationController: UIViewController { //MARK: - Touches methods to pass to annotation open override func touchesBegan(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + // We only allow one-finger touches to start annotations, as otherwise + // when you are pen-editing then try to zoom, one of your fingers will draw instead of zooming + // This is a HACK, as IDEALLY the two-finger pinch would zoom while still in + // annotation editing mode, but for the life of me I could not get that to go, forwarding + // events/touches to pretty much anything. + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let page = annotationDelegate?.annotationWillStart(touch: touch) @@ -252,14 +258,16 @@ open class PDFAnnotationController: UIViewController { open override func touchesMoved(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let point = touch.location(in: pageView) currentAnnotation?.touchMoved(touch, point: point) } open override func touchesEnded(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let point = touch.location(in: pageView) currentAnnotation?.touchEnded(touch, point: point) From 850332b5a1a4bd5ee4356f1234afcec53e21ebcb Mon Sep 17 00:00:00 2001 From: "Scott Corscadden (Morgiij)" Date: Tue, 7 Nov 2017 13:40:43 -0500 Subject: [PATCH 06/15] Work around #76: Don't draw/annotate unless only one finger is used --- .../Annotations/PDFAnnotationController.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Pod/Classes/Annotations/PDFAnnotationController.swift b/Pod/Classes/Annotations/PDFAnnotationController.swift index e0cd2b0..fcf12d3 100644 --- a/Pod/Classes/Annotations/PDFAnnotationController.swift +++ b/Pod/Classes/Annotations/PDFAnnotationController.swift @@ -231,7 +231,13 @@ open class PDFAnnotationController: UIViewController { //MARK: - Touches methods to pass to annotation open override func touchesBegan(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + // We only allow one-finger touches to start annotations, as otherwise + // when you are pen-editing then try to zoom, one of your fingers will draw instead of zooming + // This is a HACK, as IDEALLY the two-finger pinch would zoom while still in + // annotation editing mode, but for the life of me I could not get that to go, forwarding + // events/touches to pretty much anything. + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let page = annotationDelegate?.annotationWillStart(touch: touch) @@ -252,14 +258,16 @@ open class PDFAnnotationController: UIViewController { open override func touchesMoved(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let point = touch.location(in: pageView) currentAnnotation?.touchMoved(touch, point: point) } open override func touchesEnded(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let point = touch.location(in: pageView) currentAnnotation?.touchEnded(touch, point: point) From b42592c957084a1a82df336b782d4bd1d801b1d5 Mon Sep 17 00:00:00 2001 From: "Scott Corscadden (Morgiij)" Date: Mon, 13 Nov 2017 12:58:16 -0500 Subject: [PATCH 07/15] Allow setting a modalDoneButtonTouched block Default does what it always does, calls dismiss(animated: true, completion: nil) --- Pod/Classes/Renderer/PDFViewController.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Pod/Classes/Renderer/PDFViewController.swift b/Pod/Classes/Renderer/PDFViewController.swift index 20df729..eb5f142 100644 --- a/Pod/Classes/Renderer/PDFViewController.swift +++ b/Pod/Classes/Renderer/PDFViewController.swift @@ -39,6 +39,8 @@ open class PDFViewController: UIViewController { /// A boolean value that determines if view controller is displayed as modal open var isPresentingInModal: Bool = false + open var modalDoneButtonTouched: (() -> ())? + /// The scroll direction of the reader open var scrollDirection: UICollectionViewScrollDirection = .horizontal @@ -83,6 +85,9 @@ open class PDFViewController: UIViewController { public init(document: PDFDocument) { super.init(nibName: nil, bundle: nil) self.document = document + self.modalDoneButtonTouched = { [unowned self] in + self.dismiss(animated: true, completion: nil) + } } /** @@ -343,7 +348,7 @@ open class PDFViewController: UIViewController { } func dismissModal() { - dismiss(animated: true, completion: nil) + modalDoneButtonTouched?() } } From 896b3715e2c1fd2ed1211cb7d8b2f908e609d977 Mon Sep 17 00:00:00 2001 From: Jake Stephens Date: Wed, 6 Dec 2017 10:45:50 -0500 Subject: [PATCH 08/15] start up a new annotation after undoing one --- Pod/Classes/Annotations/PDFAnnotationController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Pod/Classes/Annotations/PDFAnnotationController.swift b/Pod/Classes/Annotations/PDFAnnotationController.swift index 5397d0b..89bfc03 100644 --- a/Pod/Classes/Annotations/PDFAnnotationController.swift +++ b/Pod/Classes/Annotations/PDFAnnotationController.swift @@ -176,9 +176,15 @@ open class PDFAnnotationController: UIViewController { } @IBAction func selectedUndo(_ button: PDFBarButton) { + //keep track of what kind of annotation we're adding + let currentAnnotationType = annotationType + //finish and undo it finishAnnotation() undo() + + //then start a new annotation of the same type + startAnnotation(currentAnnotationType) } func select(annotation: PDFAnnotation?) { From 9fc0082cdf6b156323fecc811d2a1ab04962df80 Mon Sep 17 00:00:00 2001 From: Jake Stephens Date: Tue, 12 Dec 2017 10:10:23 -0500 Subject: [PATCH 09/15] ensure that the specified path width gets set --- Pod/Classes/Annotations/PDFPathAnnotation.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Pod/Classes/Annotations/PDFPathAnnotation.swift b/Pod/Classes/Annotations/PDFPathAnnotation.swift index 1e37507..346d140 100644 --- a/Pod/Classes/Annotations/PDFPathAnnotation.swift +++ b/Pod/Classes/Annotations/PDFPathAnnotation.swift @@ -65,6 +65,7 @@ open class PDFPathAnnotation: NSObject, NSCoding { func drawRect(_ frame: CGRect, point: CGPoint = CGPoint.zero) { self.incrementalImage?.draw(at: point) + self.path.lineWidth = self.lineWidth self.color.setStroke() self.path.stroke() } From 41b81bcf7a100f7dfe5484a7a025cc91eebc8cda Mon Sep 17 00:00:00 2001 From: Jake Stephens Date: Tue, 12 Dec 2017 10:56:09 -0500 Subject: [PATCH 10/15] make the undo button only active when there is something to undo --- Pod/Classes/Annotations/PDFAnnotationController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Pod/Classes/Annotations/PDFAnnotationController.swift b/Pod/Classes/Annotations/PDFAnnotationController.swift index 89bfc03..8a70fd0 100644 --- a/Pod/Classes/Annotations/PDFAnnotationController.swift +++ b/Pod/Classes/Annotations/PDFAnnotationController.swift @@ -119,7 +119,8 @@ open class PDFAnnotationController: UIViewController { view.isOpaque = false view.backgroundColor = UIColor.clear - self.loadButtons(for: self.annotationTypes) + loadButtons(for: self.annotationTypes) + undoButton.isEnabled = (annotations.annotations.count > 0) } //MARK: - Annotation handling @@ -145,13 +146,16 @@ open class PDFAnnotationController: UIViewController { annotationType = type view.isUserInteractionEnabled = annotationType != nil + undoButton.isEnabled = annotationType != nil } open func finishAnnotation() { annotationType = .none addCurrentAnnotationToStore() + view.isUserInteractionEnabled = false + undoButton.isEnabled = (annotations.annotations.count > 0) } //MARK: - Bar button actions From cc5dd513bf07cb9bfb5c10181170c3df7dcc3745 Mon Sep 17 00:00:00 2001 From: Jake Stephens Date: Tue, 12 Dec 2017 11:17:11 -0500 Subject: [PATCH 11/15] fix it better - undo should still be enabled if you start an empty annotation while there are annotations in the store --- Pod/Classes/Annotations/PDFAnnotationController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pod/Classes/Annotations/PDFAnnotationController.swift b/Pod/Classes/Annotations/PDFAnnotationController.swift index 8a70fd0..69e557c 100644 --- a/Pod/Classes/Annotations/PDFAnnotationController.swift +++ b/Pod/Classes/Annotations/PDFAnnotationController.swift @@ -146,7 +146,7 @@ open class PDFAnnotationController: UIViewController { annotationType = type view.isUserInteractionEnabled = annotationType != nil - undoButton.isEnabled = annotationType != nil + undoButton.isEnabled = (annotationType != nil || annotations.annotations.count > 0) } open func finishAnnotation() { From 3dca33fbc05cb3b41b7b0ca89c2135c95e986333 Mon Sep 17 00:00:00 2001 From: Geanarcalo Kozenieski Date: Mon, 14 Jan 2019 13:08:20 -0200 Subject: [PATCH 12/15] Update Swift version to 4.2 --- CHANGELOG.md | 0 Example/ISSUE_TEMPLATE.md | 0 Example/Podfile | 0 Example/Podfile.lock | 0 .../Local Podspecs/UXMPDFKit.podspec.json | 0 Example/Pods/Manifest.lock | 0 Example/Pods/Pods.xcodeproj/project.pbxproj | 27 ++++++++++++++++-- .../contents.xcworkspacedata | 0 .../xcshareddata/xcschemes/UXMPDFKit.xcscheme | 2 +- .../Pods-UXMPDFKit_Example/Info.plist | 0 ...XMPDFKit_Example-acknowledgements.markdown | 0 ...s-UXMPDFKit_Example-acknowledgements.plist | 0 .../Pods-UXMPDFKit_Example-dummy.m | 0 .../Pods-UXMPDFKit_Example-umbrella.h | 0 .../Pods-UXMPDFKit_Example.debug.xcconfig | 0 .../Pods-UXMPDFKit_Example.modulemap | 0 .../Pods-UXMPDFKit_Example.release.xcconfig | 0 .../Target Support Files/UXMPDFKit/Info.plist | 0 .../ResourceBundle-UXMPDFKit-Info.plist | 0 .../UXMPDFKit/UXMPDFKit-dummy.m | 0 .../UXMPDFKit/UXMPDFKit-prefix.pch | 0 .../UXMPDFKit/UXMPDFKit-umbrella.h | 0 .../UXMPDFKit/UXMPDFKit.modulemap | 0 .../UXMPDFKit/UXMPDFKit.xcconfig | 0 Example/UXMPDFKit.xcodeproj/project.pbxproj | 22 ++++++++++++-- .../contents.xcworkspacedata | 0 .../xcschemes/UXMPDFKit-Example.xcscheme | 2 +- .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++ Example/UXMPDFKit/AppDelegate.swift | 2 +- Example/UXMPDFKit/Base.lproj/LaunchScreen.xib | 0 Example/UXMPDFKit/Base.lproj/Main.storyboard | 0 Example/UXMPDFKit/ExampleViewController.swift | 0 Example/UXMPDFKit/Info.plist | 0 Example/UXMPDFKit/ViewController.swift | 0 Example/UXMPDFKit/sample.pdf | Bin Example/UXMPDFKit/sample3.pdf | Bin LICENSE | 0 Package.swift | 0 Pod/Classes/.gitkeep | 0 Pod/Classes/Annotations/PDFAnnotation.swift | 0 .../Annotations/PDFAnnotationController.swift | 4 +-- .../Annotations/PDFAnnotationStore.swift | 0 .../Annotations/PDFPathAnnotation.swift | 0 .../Annotations/PDFTextAnnotation.swift | 23 +++++++++++---- Pod/Classes/Extensions/CGPoint.swift | 4 +-- Pod/Classes/Extensions/CGRect.swift | 4 +-- Pod/Classes/Extensions/UIColor.swift | 0 Pod/Classes/Extensions/UIImage.swift | 0 Pod/Classes/Extensions/UIViewController.swift | 0 Pod/Classes/Form/PDFArray.swift | 2 +- Pod/Classes/Form/PDFDictionary.swift | 0 Pod/Classes/Form/PDFFormButtonField.swift | 23 +++++++++++---- Pod/Classes/Form/PDFFormField.swift | 2 +- Pod/Classes/Form/PDFFormPageView.swift | 2 +- Pod/Classes/Form/PDFFormSignatureField.swift | 8 +++--- Pod/Classes/Form/PDFFormTextField.swift | 21 ++++++++++---- Pod/Classes/Form/PDFFormViewController.swift | 0 Pod/Classes/Form/PDFObjectParser.swift | 0 Pod/Classes/Form/PDFToggleButton.swift | 2 +- Pod/Classes/Model/PDFAction.swift | 2 +- Pod/Classes/Model/PDFActionGoTo.swift | 0 Pod/Classes/Model/PDFActionURL.swift | 0 Pod/Classes/Renderer/CGPDFDocument.swift | 0 Pod/Classes/Renderer/PDFDocument.swift | 6 ++-- Pod/Classes/Renderer/PDFDocumentLink.swift | 0 Pod/Classes/Renderer/PDFPageContent.swift | 4 +-- Pod/Classes/Renderer/PDFPageContentView.swift | 20 ++++++------- Pod/Classes/Renderer/PDFPageScrubber.swift | 12 ++++---- .../Renderer/PDFPageScrubberThumb.swift | 0 .../PDFPageScrubberTrackControl.swift | 2 +- Pod/Classes/Renderer/PDFPageTileLayer.swift | 0 Pod/Classes/Renderer/PDFRenderer.swift | 0 Pod/Classes/Renderer/PDFSinglePageCell.swift | 0 .../Renderer/PDFSinglePageViewer.swift | 2 +- Pod/Classes/Renderer/PDFSnapshotCache.swift | 2 +- Pod/Classes/Renderer/PDFThumbnailView.swift | 4 +-- .../Renderer/PDFThumbnailViewCell.swift | 0 .../Renderer/PDFThumbnailViewController.swift | 2 +- Pod/Classes/Renderer/PDFViewController.swift | 12 ++++---- Pod/Classes/TextParser/PDFTextParser.swift | 0 Pod/Classes/View/PDFBarButton.swift | 4 +-- Pod/Classes/View/ResizeableView.swift | 2 +- README.md | 0 UXMPDFKit.podspec | 0 85 files changed, 155 insertions(+), 77 deletions(-) mode change 100644 => 100755 CHANGELOG.md mode change 100644 => 100755 Example/ISSUE_TEMPLATE.md mode change 100644 => 100755 Example/Podfile mode change 100644 => 100755 Example/Podfile.lock mode change 100644 => 100755 Example/Pods/Local Podspecs/UXMPDFKit.podspec.json mode change 100644 => 100755 Example/Pods/Manifest.lock mode change 100644 => 100755 Example/Pods/Pods.xcodeproj/project.pbxproj mode change 100644 => 100755 Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata mode change 100644 => 100755 Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme mode change 100644 => 100755 Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Info.plist mode change 100644 => 100755 Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-acknowledgements.markdown mode change 100644 => 100755 Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-acknowledgements.plist mode change 100644 => 100755 Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-dummy.m mode change 100644 => 100755 Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-umbrella.h mode change 100644 => 100755 Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.debug.xcconfig mode change 100644 => 100755 Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.modulemap mode change 100644 => 100755 Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.release.xcconfig mode change 100644 => 100755 Example/Pods/Target Support Files/UXMPDFKit/Info.plist mode change 100644 => 100755 Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist mode change 100644 => 100755 Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-dummy.m mode change 100644 => 100755 Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch mode change 100644 => 100755 Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-umbrella.h mode change 100644 => 100755 Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.modulemap mode change 100644 => 100755 Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.xcconfig mode change 100644 => 100755 Example/UXMPDFKit.xcodeproj/project.pbxproj mode change 100644 => 100755 Example/UXMPDFKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata mode change 100644 => 100755 Example/UXMPDFKit.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-Example.xcscheme mode change 100644 => 100755 Example/UXMPDFKit.xcworkspace/contents.xcworkspacedata create mode 100644 Example/UXMPDFKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist mode change 100644 => 100755 Example/UXMPDFKit/AppDelegate.swift mode change 100644 => 100755 Example/UXMPDFKit/Base.lproj/LaunchScreen.xib mode change 100644 => 100755 Example/UXMPDFKit/Base.lproj/Main.storyboard mode change 100644 => 100755 Example/UXMPDFKit/ExampleViewController.swift mode change 100644 => 100755 Example/UXMPDFKit/Info.plist mode change 100644 => 100755 Example/UXMPDFKit/ViewController.swift mode change 100644 => 100755 Example/UXMPDFKit/sample.pdf mode change 100644 => 100755 Example/UXMPDFKit/sample3.pdf mode change 100644 => 100755 LICENSE mode change 100644 => 100755 Package.swift mode change 100644 => 100755 Pod/Classes/.gitkeep mode change 100644 => 100755 Pod/Classes/Annotations/PDFAnnotation.swift mode change 100644 => 100755 Pod/Classes/Annotations/PDFAnnotationController.swift mode change 100644 => 100755 Pod/Classes/Annotations/PDFAnnotationStore.swift mode change 100644 => 100755 Pod/Classes/Annotations/PDFPathAnnotation.swift mode change 100644 => 100755 Pod/Classes/Annotations/PDFTextAnnotation.swift mode change 100644 => 100755 Pod/Classes/Extensions/CGPoint.swift mode change 100644 => 100755 Pod/Classes/Extensions/CGRect.swift mode change 100644 => 100755 Pod/Classes/Extensions/UIColor.swift mode change 100644 => 100755 Pod/Classes/Extensions/UIImage.swift mode change 100644 => 100755 Pod/Classes/Extensions/UIViewController.swift mode change 100644 => 100755 Pod/Classes/Form/PDFArray.swift mode change 100644 => 100755 Pod/Classes/Form/PDFDictionary.swift mode change 100644 => 100755 Pod/Classes/Form/PDFFormButtonField.swift mode change 100644 => 100755 Pod/Classes/Form/PDFFormField.swift mode change 100644 => 100755 Pod/Classes/Form/PDFFormPageView.swift mode change 100644 => 100755 Pod/Classes/Form/PDFFormSignatureField.swift mode change 100644 => 100755 Pod/Classes/Form/PDFFormTextField.swift mode change 100644 => 100755 Pod/Classes/Form/PDFFormViewController.swift mode change 100644 => 100755 Pod/Classes/Form/PDFObjectParser.swift mode change 100644 => 100755 Pod/Classes/Form/PDFToggleButton.swift mode change 100644 => 100755 Pod/Classes/Model/PDFAction.swift mode change 100644 => 100755 Pod/Classes/Model/PDFActionGoTo.swift mode change 100644 => 100755 Pod/Classes/Model/PDFActionURL.swift mode change 100644 => 100755 Pod/Classes/Renderer/CGPDFDocument.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFDocument.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFDocumentLink.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFPageContent.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFPageContentView.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFPageScrubber.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFPageScrubberThumb.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFPageTileLayer.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFRenderer.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFSinglePageCell.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFSinglePageViewer.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFSnapshotCache.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFThumbnailView.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFThumbnailViewCell.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFThumbnailViewController.swift mode change 100644 => 100755 Pod/Classes/Renderer/PDFViewController.swift mode change 100644 => 100755 Pod/Classes/TextParser/PDFTextParser.swift mode change 100644 => 100755 Pod/Classes/View/PDFBarButton.swift mode change 100644 => 100755 Pod/Classes/View/ResizeableView.swift mode change 100644 => 100755 README.md mode change 100644 => 100755 UXMPDFKit.podspec diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/Example/ISSUE_TEMPLATE.md b/Example/ISSUE_TEMPLATE.md old mode 100644 new mode 100755 diff --git a/Example/Podfile b/Example/Podfile old mode 100644 new mode 100755 diff --git a/Example/Podfile.lock b/Example/Podfile.lock old mode 100644 new mode 100755 diff --git a/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json b/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json old mode 100644 new mode 100755 diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock old mode 100644 new mode 100755 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj old mode 100644 new mode 100755 index 28222e8..b20b6c2 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -491,8 +491,11 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 1010; TargetAttributes = { + 806AC9F20336348B8F1E6138E470491D = { + LastSwiftMigration = 1010; + }; D7C77B95095598F2FFA1E9456D29905E = { LastSwiftMigration = 0820; }; @@ -680,7 +683,8 @@ PRODUCT_NAME = UXMPDFKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -713,7 +717,8 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -767,14 +772,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -851,14 +864,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 diff --git a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme old mode 100644 new mode 100755 index a2f2807..7d60637 --- a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme +++ b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme @@ -1,6 +1,6 @@ + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/UXMPDFKit/AppDelegate.swift b/Example/UXMPDFKit/AppDelegate.swift old mode 100644 new mode 100755 index dea5111..81f97ec --- a/Example/UXMPDFKit/AppDelegate.swift +++ b/Example/UXMPDFKit/AppDelegate.swift @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { let dirPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) print("App Path: \(dirPaths)") diff --git a/Example/UXMPDFKit/Base.lproj/LaunchScreen.xib b/Example/UXMPDFKit/Base.lproj/LaunchScreen.xib old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/Base.lproj/Main.storyboard b/Example/UXMPDFKit/Base.lproj/Main.storyboard old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/ExampleViewController.swift b/Example/UXMPDFKit/ExampleViewController.swift old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/Info.plist b/Example/UXMPDFKit/Info.plist old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/ViewController.swift b/Example/UXMPDFKit/ViewController.swift old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/sample.pdf b/Example/UXMPDFKit/sample.pdf old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/sample3.pdf b/Example/UXMPDFKit/sample3.pdf old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Package.swift b/Package.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/.gitkeep b/Pod/Classes/.gitkeep old mode 100644 new mode 100755 diff --git a/Pod/Classes/Annotations/PDFAnnotation.swift b/Pod/Classes/Annotations/PDFAnnotation.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Annotations/PDFAnnotationController.swift b/Pod/Classes/Annotations/PDFAnnotationController.swift old mode 100644 new mode 100755 index e0cd2b0..fbcadb1 --- a/Pod/Classes/Annotations/PDFAnnotationController.swift +++ b/Pod/Classes/Annotations/PDFAnnotationController.swift @@ -136,7 +136,7 @@ open class PDFAnnotationController: UIViewController { for annotation in annotationsForPage { let view = annotation.mutableView() contentView.contentView.addSubview(view) - contentView.contentView.bringSubview(toFront: view) + contentView.contentView.bringSubviewToFront(view) } } @@ -188,7 +188,7 @@ open class PDFAnnotationController: UIViewController { } func loadButtons(for annotations: [PDFAnnotation.Type]) { - self.buttons = self.annotationTypes.flatMap { + self.buttons = self.annotationTypes.compactMap { if let annotation = $0 as? PDFAnnotationButtonable.Type { return PDFAnnotationBarButton( diff --git a/Pod/Classes/Annotations/PDFAnnotationStore.swift b/Pod/Classes/Annotations/PDFAnnotationStore.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Annotations/PDFPathAnnotation.swift b/Pod/Classes/Annotations/PDFPathAnnotation.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Annotations/PDFTextAnnotation.swift b/Pod/Classes/Annotations/PDFTextAnnotation.swift old mode 100644 new mode 100755 index 32d95dd..eab0f4c --- a/Pod/Classes/Annotations/PDFTextAnnotation.swift +++ b/Pod/Classes/Annotations/PDFTextAnnotation.swift @@ -95,15 +95,15 @@ extension PDFTextAnnotation: PDFAnnotation { paragraphStyle.alignment = NSTextAlignment.left let attributes: [String:AnyObject] = [ - NSFontAttributeName: font, - NSForegroundColorAttributeName: UIColor.black, - NSParagraphStyleAttributeName: paragraphStyle + convertFromNSAttributedStringKey(NSAttributedString.Key.font): font, + convertFromNSAttributedStringKey(NSAttributedString.Key.foregroundColor): UIColor.black, + convertFromNSAttributedStringKey(NSAttributedString.Key.paragraphStyle): paragraphStyle ] - let size = nsText.size(attributes: attributes) + let size = nsText.size(withAttributes: convertToOptionalNSAttributedStringKeyDictionary(attributes)) let textRect = CGRect(origin: rect.origin, size: size) - nsText.draw(in: textRect, withAttributes: attributes) + nsText.draw(in: textRect, withAttributes: convertToOptionalNSAttributedStringKeyDictionary(attributes)) UIGraphicsPopContext() } @@ -209,7 +209,7 @@ class PDFTextAnnotationView: ResizableView, PDFAnnotationView { self.addSubview(textView) } - func menuActionEdit(_ sender: Any!) { + @objc func menuActionEdit(_ sender: Any!) { self.delegate?.resizableViewDidSelectAction(view: self, action: "edit") self.isLocked = true @@ -225,3 +225,14 @@ class PDFTextAnnotationView: ResizableView, PDFAnnotationView { return super.canPerformAction(action, withSender: sender) } } + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertFromNSAttributedStringKey(_ input: NSAttributedString.Key) -> String { + return input.rawValue +} + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertToOptionalNSAttributedStringKeyDictionary(_ input: [String: Any]?) -> [NSAttributedString.Key: Any]? { + guard let input = input else { return nil } + return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)}) +} diff --git a/Pod/Classes/Extensions/CGPoint.swift b/Pod/Classes/Extensions/CGPoint.swift old mode 100644 new mode 100755 index 5dded27..de51470 --- a/Pod/Classes/Extensions/CGPoint.swift +++ b/Pod/Classes/Extensions/CGPoint.swift @@ -19,8 +19,8 @@ extension CGPoint { func rect(from point: CGPoint) -> CGRect { return CGRect(x: min(self.x, point.x), y: min(self.y, point.y), - width: fabs(self.x - point.x), - height: fabs(self.y - point.y)) + width: abs(self.x - point.x), + height: abs(self.y - point.y)) } /// Get the distance between two points diff --git a/Pod/Classes/Extensions/CGRect.swift b/Pod/Classes/Extensions/CGRect.swift old mode 100644 new mode 100755 index 94b9c25..8a8f2ae --- a/Pod/Classes/Extensions/CGRect.swift +++ b/Pod/Classes/Extensions/CGRect.swift @@ -55,8 +55,8 @@ extension CGRect { return CGRect( x: minX, y: minY, - width: fabs(maxX - minX), - height: fabs(maxY - minY) + width: abs(maxX - minX), + height: abs(maxY - minY) ) } } diff --git a/Pod/Classes/Extensions/UIColor.swift b/Pod/Classes/Extensions/UIColor.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Extensions/UIImage.swift b/Pod/Classes/Extensions/UIImage.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Extensions/UIViewController.swift b/Pod/Classes/Extensions/UIViewController.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Form/PDFArray.swift b/Pod/Classes/Form/PDFArray.swift old mode 100644 new mode 100755 index 25bb87f..de00551 --- a/Pod/Classes/Form/PDFArray.swift +++ b/Pod/Classes/Form/PDFArray.swift @@ -163,7 +163,7 @@ internal class PDFArray: PDFObject { extension PDFArray: NSCopying { func copy(with zone: NSZone?) -> Any { - return type(of: self).init(arrayRef: arr) + return Swift.type(of: self).init(arrayRef: arr) } } diff --git a/Pod/Classes/Form/PDFDictionary.swift b/Pod/Classes/Form/PDFDictionary.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Form/PDFFormButtonField.swift b/Pod/Classes/Form/PDFFormButtonField.swift old mode 100644 new mode 100755 index 82a4d93..1a96165 --- a/Pod/Classes/Form/PDFFormButtonField.swift +++ b/Pod/Classes/Form/PDFFormButtonField.swift @@ -66,7 +66,7 @@ open class PDFFormButtonField: PDFFormField { addSubview(button) } - func buttonPressed() { + @objc func buttonPressed() { value = (isSelected ? "" : exportValue) as AnyObject? delegate?.formFieldValueChanged(self) } @@ -91,7 +91,7 @@ open class PDFFormButtonField: PDFFormField { frame.origin.x += self.frame.origin.x frame.origin.y += self.frame.origin.y - let state = isSelected ? UIControlState.selected : UIControlState.normal + let state = isSelected ? UIControl.State.selected : UIControl.State.normal var title: NSString = "" let titleColor = button.titleColor(for: state) ?? UIColor.black let font: UIFont = button.titleLabel!.font @@ -106,13 +106,24 @@ open class PDFFormButtonField: PDFFormField { paragraphStyle.alignment = NSTextAlignment.center let attributes: [String:AnyObject] = [ - NSFontAttributeName: font, - NSForegroundColorAttributeName: titleColor, - NSParagraphStyleAttributeName: paragraphStyle + convertFromNSAttributedStringKey(NSAttributedString.Key.font): font, + convertFromNSAttributedStringKey(NSAttributedString.Key.foregroundColor): titleColor, + convertFromNSAttributedStringKey(NSAttributedString.Key.paragraphStyle): paragraphStyle ] - title.draw(in: frame, withAttributes: attributes) + title.draw(in: frame, withAttributes: convertToOptionalNSAttributedStringKeyDictionary(attributes)) UIGraphicsPopContext() } } + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertFromNSAttributedStringKey(_ input: NSAttributedString.Key) -> String { + return input.rawValue +} + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertToOptionalNSAttributedStringKeyDictionary(_ input: [String: Any]?) -> [NSAttributedString.Key: Any]? { + guard let input = input else { return nil } + return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)}) +} diff --git a/Pod/Classes/Form/PDFFormField.swift b/Pod/Classes/Form/PDFFormField.swift old mode 100644 new mode 100755 index e89a565..85a4dd9 --- a/Pod/Classes/Form/PDFFormField.swift +++ b/Pod/Classes/Form/PDFFormField.swift @@ -32,7 +32,7 @@ open class PDFFormFieldObject { let flags: [PDFFormFlag] if let flagsObj = dict["Ff"] as? NSNumber { - flags = self.determineFlags(UInt(flagsObj)) + flags = self.determineFlags(UInt(truncating: flagsObj)) } else { flags = [] diff --git a/Pod/Classes/Form/PDFFormPageView.swift b/Pod/Classes/Form/PDFFormPageView.swift old mode 100644 new mode 100755 index 9e3b729..b633df8 --- a/Pod/Classes/Form/PDFFormPageView.swift +++ b/Pod/Classes/Form/PDFFormPageView.swift @@ -60,7 +60,7 @@ open class PDFFormPage: NSObject { contentView.viewDidZoom = { scale in formView.updateWithZoom(scale) } - contentView.sendSubview(toBack: formView) + contentView.sendSubviewToBack(formView) } func createFormField(_ dict: PDFDictionary) { diff --git a/Pod/Classes/Form/PDFFormSignatureField.swift b/Pod/Classes/Form/PDFFormSignatureField.swift old mode 100644 new mode 100755 index e7a013c..4b24e84 --- a/Pod/Classes/Form/PDFFormSignatureField.swift +++ b/Pod/Classes/Form/PDFFormSignatureField.swift @@ -17,10 +17,10 @@ open class PDFFormSignatureField: PDFFormField { lazy fileprivate var signButton: UIButton = { var button = UIButton(frame: CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height)) - button.setTitle("Tap To Sign", for: UIControlState()) + button.setTitle("Tap To Sign", for: UIControl.State()) button.tintColor = UIColor.black button.titleLabel?.font = UIFont.systemFont(ofSize: 14.0) - button.setTitleColor(UIColor.black, for: UIControlState()) + button.setTitleColor(UIColor.black, for: UIControl.State()) button.addTarget(self, action: #selector(PDFFormSignatureField.addSignature), for: .touchUpInside) button.isUserInteractionEnabled = true button.isExclusiveTouch = true @@ -48,7 +48,7 @@ open class PDFFormSignatureField: PDFFormField { addSubview(signImage) addSubview(signButton) - bringSubview(toFront: signButton) + bringSubviewToFront(signButton) } required public init?(coder aDecoder: NSCoder) { @@ -61,7 +61,7 @@ open class PDFFormSignatureField: PDFFormField { } } - func addSignature() { + @objc func addSignature() { let vc = PDFFormSignatureViewController() vc.delegate = self diff --git a/Pod/Classes/Form/PDFFormTextField.swift b/Pod/Classes/Form/PDFFormTextField.swift old mode 100644 new mode 100755 index bb4040a..394528c --- a/Pod/Classes/Form/PDFFormTextField.swift +++ b/Pod/Classes/Form/PDFFormTextField.swift @@ -59,7 +59,7 @@ open class PDFFormTextField: PDFFormField { textView.autoresizingMask = [.flexibleWidth, .flexibleHeight] textView.delegate = self textView.isScrollEnabled = true - textView.textContainerInset = UIEdgeInsetsMake(4, 4, 4, 4) + textView.textContainerInset = UIEdgeInsets.init(top: 4, left: 4, bottom: 4, right: 4) let fontSize = fontSizeForRect(frame) < 13.0 ? fontSizeForRect(frame) : 13.0 textView.font = UIFont.systemFont(ofSize: fontSize) } @@ -119,14 +119,14 @@ open class PDFFormTextField: PDFFormField { } /// UGLY - (text as NSString!).draw(in: frame, withAttributes: [ - NSFontAttributeName: font - ]) + (text as NSString).draw(in: frame, withAttributes: convertToOptionalNSAttributedStringKeyDictionary([ + convertFromNSAttributedStringKey(NSAttributedString.Key.font): font + ])) } } extension PDFFormTextField: UITextFieldDelegate { - func textChanged() { + @objc func textChanged() { value = text as AnyObject? delegate?.formFieldValueChanged(self) } @@ -153,3 +153,14 @@ extension PDFFormTextField: UITextViewDelegate { return false } } + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertToOptionalNSAttributedStringKeyDictionary(_ input: [String: Any]?) -> [NSAttributedString.Key: Any]? { + guard let input = input else { return nil } + return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)}) +} + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertFromNSAttributedStringKey(_ input: NSAttributedString.Key) -> String { + return input.rawValue +} diff --git a/Pod/Classes/Form/PDFFormViewController.swift b/Pod/Classes/Form/PDFFormViewController.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Form/PDFObjectParser.swift b/Pod/Classes/Form/PDFObjectParser.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Form/PDFToggleButton.swift b/Pod/Classes/Form/PDFToggleButton.swift old mode 100644 new mode 100755 index 45a944c..557615c --- a/Pod/Classes/Form/PDFToggleButton.swift +++ b/Pod/Classes/Form/PDFToggleButton.swift @@ -28,7 +28,7 @@ class PDFToggleButton: UIButton { titleLabel?.font = UIFont(name: "ZapfDingbatsITC", size: 10) } - func buttonTapped() { + @objc func buttonTapped() { self.isSelected = !self.isSelected } } diff --git a/Pod/Classes/Model/PDFAction.swift b/Pod/Classes/Model/PDFAction.swift old mode 100644 new mode 100755 index dfa7fcb..a530208 --- a/Pod/Classes/Model/PDFAction.swift +++ b/Pod/Classes/Model/PDFAction.swift @@ -9,7 +9,7 @@ import Foundation open class PDFAction { - open static func fromPDFDictionary(_ sourceDictionary: CGPDFDictionaryRef, documentReference: CGPDFDocument) -> PDFAction? { + public static func fromPDFDictionary(_ sourceDictionary: CGPDFDictionaryRef, documentReference: CGPDFDocument) -> PDFAction? { var action: PDFAction? var destinationName: CGPDFStringRef? = nil var destinationString: UnsafePointer? = nil diff --git a/Pod/Classes/Model/PDFActionGoTo.swift b/Pod/Classes/Model/PDFActionGoTo.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Model/PDFActionURL.swift b/Pod/Classes/Model/PDFActionURL.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/CGPDFDocument.swift b/Pod/Classes/Renderer/CGPDFDocument.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/PDFDocument.swift b/Pod/Classes/Renderer/PDFDocument.swift old mode 100644 new mode 100755 index 82b9704..1aa7dd8 --- a/Pod/Classes/Renderer/PDFDocument.swift +++ b/Pod/Classes/Renderer/PDFDocument.swift @@ -205,16 +205,16 @@ open class PDFDocument: NSObject, NSCoding { return ProcessInfo.processInfo.globallyUniqueString } - open static func documentsPath() -> String { + public static func documentsPath() -> String { return NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] } - open static func applicationPath() -> String { + public static func applicationPath() -> String { let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) return (paths.first! as NSString).deletingLastPathComponent } - open static func applicationSupportPath() -> String { + public static func applicationSupportPath() -> String { let fileManager = FileManager() let pathURL = try! fileManager.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true) return pathURL.path diff --git a/Pod/Classes/Renderer/PDFDocumentLink.swift b/Pod/Classes/Renderer/PDFDocumentLink.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/PDFPageContent.swift b/Pod/Classes/Renderer/PDFPageContent.swift old mode 100644 new mode 100755 index 9272dd7..48ba64a --- a/Pod/Classes/Renderer/PDFPageContent.swift +++ b/Pod/Classes/Renderer/PDFPageContent.swift @@ -85,7 +85,7 @@ public class PDFPageContent: UIView { autoresizesSubviews = false isUserInteractionEnabled = true contentMode = .redraw - autoresizingMask = UIViewAutoresizing() + autoresizingMask = UIView.AutoresizingMask() backgroundColor = UIColor.clear buildAnnotationLinksList() @@ -115,7 +115,7 @@ public class PDFPageContent: UIView { highlight.autoresizesSubviews = false highlight.isUserInteractionEnabled = false highlight.contentMode = .redraw - highlight.autoresizingMask = UIViewAutoresizing() + highlight.autoresizingMask = UIView.AutoresizingMask() highlight.backgroundColor = color addSubview(highlight) diff --git a/Pod/Classes/Renderer/PDFPageContentView.swift b/Pod/Classes/Renderer/PDFPageContentView.swift old mode 100644 new mode 100755 index 1ea7967..99c57a8 --- a/Pod/Classes/Renderer/PDFPageContentView.swift +++ b/Pod/Classes/Renderer/PDFPageContentView.swift @@ -72,12 +72,12 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { NotificationCenter.default.addObserver( self, selector: #selector(PDFPageContentView.keyboardWillShowNotification(_:)), - name: .UIKeyboardWillShow, + name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver( self, selector: #selector(PDFPageContentView.keyboardWillHideNotification(_:)), - name: .UIKeyboardWillHide, + name: UIResponder.keyboardWillHideNotification, object: nil ) @@ -106,8 +106,8 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { } deinit { - NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillShow, object: nil) - NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillHide, object: nil) + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil) + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil) self.removeObserver(self, forKeyPath: "frame") } @@ -147,7 +147,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { self.zoomReset() } - open func processSingleTap(_ recognizer: UITapGestureRecognizer) { + @objc open func processSingleTap(_ recognizer: UITapGestureRecognizer) { if let action = contentView.processSingleTap(recognizer) as? PDFAction { contentDelegate?.contentView(self, didSelect: action) } @@ -159,7 +159,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { } } - open func processDoubleTap(_ recognizer: UITapGestureRecognizer) { + @objc open func processDoubleTap(_ recognizer: UITapGestureRecognizer) { contentDelegate?.contentView(self, doubleTapped: recognizer) } @@ -218,18 +218,18 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { viewDidZoom?(scrollView.zoomScale) } - func keyboardWillShowNotification(_ notification: Notification) { + @objc func keyboardWillShowNotification(_ notification: Notification) { updateBottomLayoutConstraintWithNotification(notification, show: true) } - func keyboardWillHideNotification(_ notification: Notification) { + @objc func keyboardWillHideNotification(_ notification: Notification) { updateBottomLayoutConstraintWithNotification(notification, show: false) } func updateBottomLayoutConstraintWithNotification(_ notification: Notification, show:Bool) { let userInfo = (notification as NSNotification).userInfo! - let keyboardEndFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as! NSValue).cgRectValue + let keyboardEndFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue let convertedKeyboardEndFrame = self.convert(keyboardEndFrame, from: self.window) let height: CGFloat @@ -239,7 +239,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { height = 0 } - contentInset = UIEdgeInsetsMake(0, 0, height, 0) + contentInset = UIEdgeInsets.init(top: 0, left: 0, bottom: height, right: 0) } diff --git a/Pod/Classes/Renderer/PDFPageScrubber.swift b/Pod/Classes/Renderer/PDFPageScrubber.swift old mode 100644 new mode 100755 index 46fe01c..80ca75e --- a/Pod/Classes/Renderer/PDFPageScrubber.swift +++ b/Pod/Classes/Renderer/PDFPageScrubber.swift @@ -70,7 +70,7 @@ open class PDFPageScrubber: UIToolbar { let pageNumberLabel = UILabel(frame: textRect) pageNumberLabel.autoresizesSubviews = false - pageNumberLabel.autoresizingMask = UIViewAutoresizing() + pageNumberLabel.autoresizingMask = UIView.AutoresizingMask() pageNumberLabel.textAlignment = .center pageNumberLabel.backgroundColor = UIColor.clear pageNumberLabel.textColor = UIColor.darkText @@ -245,7 +245,7 @@ open class PDFPageScrubber: UIToolbar { } } - func trackTimerFired(_ timer: Timer) { + @objc func trackTimerFired(_ timer: Timer) { trackTimer?.invalidate() trackTimer = nil if scrubber.tag != document.currentPage { @@ -253,7 +253,7 @@ open class PDFPageScrubber: UIToolbar { } } - func enableTimerFired(_ timer: Timer) { + @objc func enableTimerFired(_ timer: Timer) { enableTimer?.invalidate() enableTimer = nil scrubber.isUserInteractionEnabled = true @@ -292,7 +292,7 @@ open class PDFPageScrubber: UIToolbar { return page + 1 } - func scrubberTouchDown(_ scrubber: PDFPageScrubberTrackControl) { + @objc func scrubberTouchDown(_ scrubber: PDFPageScrubberTrackControl) { let page = scrubberPageNumber(scrubber) if page != document.currentPage { @@ -304,7 +304,7 @@ open class PDFPageScrubber: UIToolbar { scrubber.tag = page } - func scrubberTouchUp(_ scrubber: PDFPageScrubberTrackControl) { + @objc func scrubberTouchUp(_ scrubber: PDFPageScrubberTrackControl) { if trackTimer != nil { trackTimer?.invalidate() trackTimer = nil @@ -319,7 +319,7 @@ open class PDFPageScrubber: UIToolbar { scrubber.tag = 0 } - func scrubberValueChanged(_ scrubber: PDFPageScrubberTrackControl) { + @objc func scrubberValueChanged(_ scrubber: PDFPageScrubberTrackControl) { let page = self.scrubberPageNumber(scrubber) if page != scrubber.tag { updatePageNumberText(page) diff --git a/Pod/Classes/Renderer/PDFPageScrubberThumb.swift b/Pod/Classes/Renderer/PDFPageScrubberThumb.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift b/Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift old mode 100644 new mode 100755 index 38840f3..3c1aa32 --- a/Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift +++ b/Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift @@ -17,7 +17,7 @@ internal class PDFPageScrubberTrackControl: UIControl { autoresizesSubviews = false isUserInteractionEnabled = true contentMode = .redraw - autoresizingMask = UIViewAutoresizing() + autoresizingMask = UIView.AutoresizingMask() backgroundColor = UIColor.clear isExclusiveTouch = true } diff --git a/Pod/Classes/Renderer/PDFPageTileLayer.swift b/Pod/Classes/Renderer/PDFPageTileLayer.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/PDFRenderer.swift b/Pod/Classes/Renderer/PDFRenderer.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/PDFSinglePageCell.swift b/Pod/Classes/Renderer/PDFSinglePageCell.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/PDFSinglePageViewer.swift b/Pod/Classes/Renderer/PDFSinglePageViewer.swift old mode 100644 new mode 100755 index 4676ae1..42441ac --- a/Pod/Classes/Renderer/PDFSinglePageViewer.swift +++ b/Pod/Classes/Renderer/PDFSinglePageViewer.swift @@ -32,7 +32,7 @@ open class PDFSinglePageViewer: UICollectionView { var internalPage: Int = 0 - var scrollDirection: UICollectionViewScrollDirection { + var scrollDirection: UICollectionView.ScrollDirection { let flowLayout = collectionViewLayout as! UICollectionViewFlowLayout return flowLayout.scrollDirection } diff --git a/Pod/Classes/Renderer/PDFSnapshotCache.swift b/Pod/Classes/Renderer/PDFSnapshotCache.swift old mode 100644 new mode 100755 index b928243..2790091 --- a/Pod/Classes/Renderer/PDFSnapshotCache.swift +++ b/Pod/Classes/Renderer/PDFSnapshotCache.swift @@ -65,7 +65,7 @@ open class PDFQueue { renderQueue.addOperation(thumbRender) } - open static func fetchPage(_ document: PDFDocument, page: Int, size: CGSize, completion:((PDFSnapshot) -> Void)?) { + public static func fetchPage(_ document: PDFDocument, page: Int, size: CGSize, completion:((PDFSnapshot) -> Void)?) { self.sharedQueue.fetchPage(document, page: page, size: size, completion:completion) } } diff --git a/Pod/Classes/Renderer/PDFThumbnailView.swift b/Pod/Classes/Renderer/PDFThumbnailView.swift old mode 100644 new mode 100755 index 5c31902..0a11156 --- a/Pod/Classes/Renderer/PDFThumbnailView.swift +++ b/Pod/Classes/Renderer/PDFThumbnailView.swift @@ -15,7 +15,7 @@ internal class PDFThumbnailView: UIView { imageView = UIImageView() imageView.autoresizesSubviews = false imageView.isUserInteractionEnabled = false - imageView.autoresizingMask = UIViewAutoresizing() + imageView.autoresizingMask = UIView.AutoresizingMask() imageView.translatesAutoresizingMaskIntoConstraints = false imageView.contentMode = .scaleAspectFit @@ -27,7 +27,7 @@ internal class PDFThumbnailView: UIView { autoresizesSubviews = false isUserInteractionEnabled = false contentMode = .redraw - autoresizingMask = UIViewAutoresizing() + autoresizingMask = UIView.AutoresizingMask() backgroundColor = UIColor.clear var constraints = NSLayoutConstraint.constraints(withVisualFormat: "H:[image]|", options: .alignAllLastBaseline, metrics: nil, views: [ "superview": self, "image": imageView ]) diff --git a/Pod/Classes/Renderer/PDFThumbnailViewCell.swift b/Pod/Classes/Renderer/PDFThumbnailViewCell.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/PDFThumbnailViewController.swift b/Pod/Classes/Renderer/PDFThumbnailViewController.swift old mode 100644 new mode 100755 index 4e41301..44a8d2e --- a/Pod/Classes/Renderer/PDFThumbnailViewController.swift +++ b/Pod/Classes/Renderer/PDFThumbnailViewController.swift @@ -20,7 +20,7 @@ open class PDFThumbnailViewController: UIViewController { private var flowLayout: UICollectionViewFlowLayout { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .vertical - layout.sectionInset = UIEdgeInsetsMake(20, 20, 20, 20) + layout.sectionInset = UIEdgeInsets.init(top: 20, left: 20, bottom: 20, right: 20) layout.minimumLineSpacing = 0.0 layout.minimumInteritemSpacing = 0.0 return layout diff --git a/Pod/Classes/Renderer/PDFViewController.swift b/Pod/Classes/Renderer/PDFViewController.swift old mode 100644 new mode 100755 index 9a964a2..107de68 --- a/Pod/Classes/Renderer/PDFViewController.swift +++ b/Pod/Classes/Renderer/PDFViewController.swift @@ -37,7 +37,7 @@ open class PDFViewController: UIViewController { open var isPresentingInModal: Bool = false /// The scroll direction of the reader - open var scrollDirection: UICollectionViewScrollDirection = .horizontal + open var scrollDirection: UICollectionView.ScrollDirection = .horizontal /// A reference to the document that is being displayed var document: PDFDocument! @@ -165,7 +165,7 @@ open class PDFViewController: UIViewController { super.viewWillTransition(to: size, with: coordinator) coordinator.animate(alongsideTransition: { (context) in - self.collectionView.contentInset = UIEdgeInsetsMake(self.topLayoutGuide.length, 0, self.bottomLayoutGuide.length, 0) + self.collectionView.contentInset = UIEdgeInsets(top: self.topLayoutGuide.length, left: 0, bottom: self.bottomLayoutGuide.length, right: 0) self.collectionView.collectionViewLayout.invalidateLayout() self.pageScrubber.sizeToFit() }, completion: { (context) in @@ -237,7 +237,7 @@ open class PDFViewController: UIViewController { return buttons } - func toggleAnnotations(_ button: PDFBarButton) { + @objc func toggleAnnotations(_ button: PDFBarButton) { showingAnnotations = !showingAnnotations reloadBarButtons() } @@ -261,7 +261,7 @@ open class PDFViewController: UIViewController { present(activityVC, animated: true, completion: nil) } - func showThumbnailView() { + @objc func showThumbnailView() { let vc = PDFThumbnailViewController(document: document) vc.delegate = self let nvc = UINavigationController(rootViewController: vc) @@ -296,11 +296,11 @@ open class PDFViewController: UIViewController { self.toggleBars() } - func shareDocument() { + @objc func shareDocument() { self.shareBarButtonAction() } - func dismissModal() { + @objc func dismissModal() { dismiss(animated: true, completion: nil) } } diff --git a/Pod/Classes/TextParser/PDFTextParser.swift b/Pod/Classes/TextParser/PDFTextParser.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/View/PDFBarButton.swift b/Pod/Classes/View/PDFBarButton.swift old mode 100644 new mode 100755 index 9a49462..bcacd21 --- a/Pod/Classes/View/PDFBarButton.swift +++ b/Pod/Classes/View/PDFBarButton.swift @@ -40,7 +40,7 @@ open class PDFBarButton: UIBarButtonItem { self.block = block button.addTarget(self, action: #selector(PDFBarButton.tapped), for: .touchUpInside) - button.setImage(image?.withRenderingMode(.alwaysTemplate), for: UIControlState()) + button.setImage(image?.withRenderingMode(.alwaysTemplate), for: UIControl.State()) } open func toggle(_ state: Bool) { @@ -57,7 +57,7 @@ open class PDFBarButton: UIBarButtonItem { } } - func tapped() { + @objc func tapped() { let _ = self.target?.perform(self.action, with: self) self.block?(self) } diff --git a/Pod/Classes/View/ResizeableView.swift b/Pod/Classes/View/ResizeableView.swift old mode 100644 new mode 100755 index cced88a..67162a7 --- a/Pod/Classes/View/ResizeableView.swift +++ b/Pod/Classes/View/ResizeableView.swift @@ -344,7 +344,7 @@ open class ResizableView: UIView { self.resignFirstResponder() } - func menuActionDelete(_ sender: Any!) { + @objc func menuActionDelete(_ sender: Any!) { self.delegate?.resizableViewDidSelectAction(view: self, action: "delete") } diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/UXMPDFKit.podspec b/UXMPDFKit.podspec old mode 100644 new mode 100755 From 8dbfdbd8c865390a49f9de97c96bd2a82aa16f4d Mon Sep 17 00:00:00 2001 From: Geanarcalo Kozenieski Date: Mon, 14 Jan 2019 13:16:25 -0200 Subject: [PATCH 13/15] Update pod version --- UXMPDFKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UXMPDFKit.podspec b/UXMPDFKit.podspec index 6767ff3..840fe83 100755 --- a/UXMPDFKit.podspec +++ b/UXMPDFKit.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "UXMPDFKit" - s.version = "0.7.2" + s.version = "0.7.3" s.summary = "A fully functioning PDF reader written completely in Swift" s.homepage = "https://github.com/uxmstudio/UXMPDFKit" From e975b8ad0491759a696638d03d1203b3cdad058c Mon Sep 17 00:00:00 2001 From: Scott Corscadden Date: Wed, 3 May 2023 11:25:52 -0400 Subject: [PATCH 14/15] Fix conflict with UIView.anchorPoint --> ResizableView.resizableViewAnchorPoint --- Pod/Classes/View/ResizeableView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pod/Classes/View/ResizeableView.swift b/Pod/Classes/View/ResizeableView.swift index 67162a7..219cde9 100755 --- a/Pod/Classes/View/ResizeableView.swift +++ b/Pod/Classes/View/ResizeableView.swift @@ -41,7 +41,7 @@ open class ResizableView: UIView { var touchStart: CGPoint? var minWidth: CGFloat = 48.0 var minHeight: CGFloat = 48.0 - var anchorPoint: ResizableViewAnchorPoint? + var resizableViewAnchorPoint: ResizableViewAnchorPoint? var delegate: ResizableViewDelegate? var preventsPositionOutsideSuperview: Bool = true var isLocked = false { @@ -73,7 +73,7 @@ open class ResizableView: UIView { } var isResizing: Bool { get { - guard let anchorPoint = self.anchorPoint else { return false } + guard let anchorPoint = self.resizableViewAnchorPoint else { return false } return anchorPoint.adjustsH != 0.0 || anchorPoint.adjustsW != 0.0 || anchorPoint.adjustsX != 0.0 @@ -184,7 +184,7 @@ open class ResizableView: UIView { self.delegate?.resizableViewDidBeginEditing(view: self) self.borderView.isHidden = false - self.anchorPoint = self.anchorPoint(touch: touch.location(in: self)) + self.resizableViewAnchorPoint = self.anchorPoint(touch: touch.location(in: self)) self.touchStart = touch.location(in: self.superview) if !self.isResizing { @@ -235,7 +235,7 @@ open class ResizableView: UIView { guard let superview = self.superview, let touchStart = self.touchStart, - let anchorPoint = self.anchorPoint else { return } + let anchorPoint = self.resizableViewAnchorPoint else { return } // (1) Update the touch point if we're outside the superview. if self.preventsPositionOutsideSuperview { From 6d41eb3005934b679986936a6fd31d6eaa8aa09d Mon Sep 17 00:00:00 2001 From: Scott Corscadden Date: Wed, 17 May 2023 13:23:34 -0400 Subject: [PATCH 15/15] Comment sanitization --- Pod/Classes/Form/PDFFormTextField.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Pod/Classes/Form/PDFFormTextField.swift b/Pod/Classes/Form/PDFFormTextField.swift index 394528c..5ba47d6 100755 --- a/Pod/Classes/Form/PDFFormTextField.swift +++ b/Pod/Classes/Form/PDFFormTextField.swift @@ -118,7 +118,6 @@ open class PDFFormTextField: PDFFormField { fatalError() } - /// UGLY (text as NSString).draw(in: frame, withAttributes: convertToOptionalNSAttributedStringKeyDictionary([ convertFromNSAttributedStringKey(NSAttributedString.Key.font): font ]))