From a921d1eb6a636d5393be5b24d96618b48554b695 Mon Sep 17 00:00:00 2001 From: Eryk Mariankowski Date: Sun, 2 Dec 2018 17:07:15 +0100 Subject: [PATCH 1/8] swift 4.2 and Xcode 10 renames --- Pod/Classes/EPExtensions.swift | 4 ++-- Pod/Classes/EPSignatureViewController.swift | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Pod/Classes/EPExtensions.swift b/Pod/Classes/EPExtensions.swift index 17a3610..6b04fb8 100644 --- a/Pod/Classes/EPExtensions.swift +++ b/Pod/Classes/EPExtensions.swift @@ -17,10 +17,10 @@ extension UIViewController { } func showAlert(_ message: String, andTitle title: String) { - let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) + let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) // add an action (button) - alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil)) + alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil)) // show the alert self.present(alert, animated: true, completion: nil) diff --git a/Pod/Classes/EPSignatureViewController.swift b/Pod/Classes/EPSignatureViewController.swift index 249d3b8..6ff07fb 100644 --- a/Pod/Classes/EPSignatureViewController.swift +++ b/Pod/Classes/EPSignatureViewController.swift @@ -39,13 +39,13 @@ open class EPSignatureViewController: UIViewController { override open func viewDidLoad() { super.viewDidLoad() - let cancelButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.cancel, target: self, action: #selector(EPSignatureViewController.onTouchCancelButton)) + let cancelButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.cancel, target: self, action: #selector(EPSignatureViewController.onTouchCancelButton)) cancelButton.tintColor = tintColor self.navigationItem.leftBarButtonItem = cancelButton - let doneButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.done, target: self, action: #selector(EPSignatureViewController.onTouchDoneButton)) + let doneButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.done, target: self, action: #selector(EPSignatureViewController.onTouchDoneButton)) doneButton.tintColor = tintColor - let clearButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.trash, target: self, action: #selector(EPSignatureViewController.onTouchClearButton)) + let clearButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.trash, target: self, action: #selector(EPSignatureViewController.onTouchClearButton)) clearButton.tintColor = tintColor if showsDate { @@ -58,7 +58,7 @@ open class EPSignatureViewController: UIViewController { } if showsSaveSignatureOption { - let actionButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.action, target: self, action: #selector(EPSignatureViewController.onTouchActionButton(_:))) + let actionButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.action, target: self, action: #selector(EPSignatureViewController.onTouchActionButton(_:))) actionButton.tintColor = tintColor self.navigationItem.rightBarButtonItems = [doneButton, clearButton, actionButton] switchSaveSignature.onTintColor = tintColor @@ -121,20 +121,20 @@ open class EPSignatureViewController: UIViewController { } @objc func onTouchActionButton(_ barButton: UIBarButtonItem) { - let action = UIAlertController(title: "Action", message: "", preferredStyle: UIAlertControllerStyle.actionSheet) + let action = UIAlertController(title: "Action", message: "", preferredStyle: UIAlertController.Style.actionSheet) action.view.tintColor = tintColor - action.addAction(UIAlertAction(title: "Load default signature", style: UIAlertActionStyle.default, handler: { action in + action.addAction(UIAlertAction(title: "Load default signature", style: UIAlertAction.Style.default, handler: { action in let docPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first let filePath = (docPath! as NSString).appendingPathComponent("sig.data") self.signatureView.loadSignature(filePath) })) - action.addAction(UIAlertAction(title: "Delete default signature", style: UIAlertActionStyle.destructive, handler: { action in + action.addAction(UIAlertAction(title: "Delete default signature", style: UIAlertAction.Style.destructive, handler: { action in self.signatureView.removeSignature() })) - action.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil)) + action.addAction(UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: nil)) if let popOver = action.popoverPresentationController { popOver.barButtonItem = barButton From 3111892cf5df2b2a1ca4b448a54fb2aa24842bad Mon Sep 17 00:00:00 2001 From: Eryk Mariankowski Date: Tue, 8 Jan 2019 00:40:53 +0100 Subject: [PATCH 2/8] =?UTF-8?q?004321=20t=C5=82umaczenia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pod/Classes/EPExtensions.swift | 2 +- Pod/Classes/EPSignatureViewController.swift | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Pod/Classes/EPExtensions.swift b/Pod/Classes/EPExtensions.swift index 6b04fb8..3817edb 100644 --- a/Pod/Classes/EPExtensions.swift +++ b/Pod/Classes/EPExtensions.swift @@ -16,7 +16,7 @@ extension UIViewController { showAlert(message, andTitle: "") } - func showAlert(_ message: String, andTitle title: String) { + public func showAlert(_ message: String, andTitle title: String) { let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) // add an action (button) diff --git a/Pod/Classes/EPSignatureViewController.swift b/Pod/Classes/EPSignatureViewController.swift index 6ff07fb..f895328 100644 --- a/Pod/Classes/EPSignatureViewController.swift +++ b/Pod/Classes/EPSignatureViewController.swift @@ -18,13 +18,13 @@ open class EPSignatureViewController: UIViewController { // MARK: - IBOutlets - @IBOutlet weak var switchSaveSignature: UISwitch! + @IBOutlet public weak var switchSaveSignature: UISwitch! @IBOutlet weak var lblSignatureSubtitle: UILabel! @IBOutlet weak var lblDefaultSignature: UILabel! @IBOutlet weak var lblDate: UILabel! @IBOutlet weak var viewMargin: UIView! @IBOutlet weak var lblX: UILabel! - @IBOutlet weak var signatureView: EPSignatureView! + @IBOutlet public weak var signatureView: EPSignatureView! // MARK: - Public Vars @@ -106,7 +106,8 @@ open class EPSignatureViewController: UIViewController { dismiss(animated: true, completion: nil) } - @objc func onTouchDoneButton() { + @objc + open func onTouchDoneButton() { if let signature = signatureView.getSignatureAsImage() { if switchSaveSignature.isOn { let docPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first From be50ffb49eda14e837e351c964e70978e7ffba69 Mon Sep 17 00:00:00 2001 From: Eryk Mariankowski Date: Tue, 8 Jan 2019 15:06:24 +0100 Subject: [PATCH 3/8] =?UTF-8?q?004321=20skalowanie=20podpiso=CC=81w=20i=20?= =?UTF-8?q?nazwa=20zgodna=20z=20Android?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pod/Classes/EPSignatureViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pod/Classes/EPSignatureViewController.swift b/Pod/Classes/EPSignatureViewController.swift index f895328..a5ddbc7 100644 --- a/Pod/Classes/EPSignatureViewController.swift +++ b/Pod/Classes/EPSignatureViewController.swift @@ -19,8 +19,8 @@ open class EPSignatureViewController: UIViewController { // MARK: - IBOutlets @IBOutlet public weak var switchSaveSignature: UISwitch! - @IBOutlet weak var lblSignatureSubtitle: UILabel! - @IBOutlet weak var lblDefaultSignature: UILabel! + @IBOutlet public weak var lblSignatureSubtitle: UILabel! + @IBOutlet public weak var lblDefaultSignature: UILabel! @IBOutlet weak var lblDate: UILabel! @IBOutlet weak var viewMargin: UIView! @IBOutlet weak var lblX: UILabel! From 244bbf010cd46aef3573a27e48fbd081359234b2 Mon Sep 17 00:00:00 2001 From: Eryk Mariankowski Date: Wed, 9 Jan 2019 12:39:24 +0100 Subject: [PATCH 4/8] =?UTF-8?q?004305=20protoko=CC=81=C5=82=20zdania,=20us?= =?UTF-8?q?zkodzenia=20zdania,=20podpisy=20zdania,=20automatyczny=20pracow?= =?UTF-8?q?nik,=20zdanie=20zakon=CC=81czone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pod/Classes/EPSignatureViewController.swift | 5 ++-- Pod/Classes/EPSignatureViewController.xib | 28 ++++++++++++++------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Pod/Classes/EPSignatureViewController.swift b/Pod/Classes/EPSignatureViewController.swift index a5ddbc7..6facc03 100644 --- a/Pod/Classes/EPSignatureViewController.swift +++ b/Pod/Classes/EPSignatureViewController.swift @@ -18,6 +18,7 @@ open class EPSignatureViewController: UIViewController { // MARK: - IBOutlets + @IBOutlet public weak var lblTitle: UILabel! @IBOutlet public weak var switchSaveSignature: UISwitch! @IBOutlet public weak var lblSignatureSubtitle: UILabel! @IBOutlet public weak var lblDefaultSignature: UILabel! @@ -40,8 +41,8 @@ open class EPSignatureViewController: UIViewController { super.viewDidLoad() let cancelButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.cancel, target: self, action: #selector(EPSignatureViewController.onTouchCancelButton)) - cancelButton.tintColor = tintColor - self.navigationItem.leftBarButtonItem = cancelButton +// cancelButton.tintColor = tintColor +// self.navigationItem.leftBarButtonItem = cancelButton let doneButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.done, target: self, action: #selector(EPSignatureViewController.onTouchDoneButton)) doneButton.tintColor = tintColor diff --git a/Pod/Classes/EPSignatureViewController.xib b/Pod/Classes/EPSignatureViewController.xib index 39d1bf4..4734135 100644 --- a/Pod/Classes/EPSignatureViewController.xib +++ b/Pod/Classes/EPSignatureViewController.xib @@ -1,11 +1,11 @@ - + - + @@ -15,6 +15,7 @@ + @@ -28,9 +29,15 @@ - + + From 092c08809d0c09271a4e354a2db0fa6326500369 Mon Sep 17 00:00:00 2001 From: Eryk Mariankowski Date: Thu, 10 Jan 2019 14:43:40 +0100 Subject: [PATCH 5/8] =?UTF-8?q?004307=20obrazki=20na=20buttonach,=20bia?= =?UTF-8?q?=C5=82e=20napisy=20w=20inputAccessoryView,=20network=20error=20?= =?UTF-8?q?handler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pod/Classes/EPSignatureViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pod/Classes/EPSignatureViewController.swift b/Pod/Classes/EPSignatureViewController.swift index 6facc03..dd58bc8 100644 --- a/Pod/Classes/EPSignatureViewController.swift +++ b/Pod/Classes/EPSignatureViewController.swift @@ -45,9 +45,9 @@ open class EPSignatureViewController: UIViewController { // self.navigationItem.leftBarButtonItem = cancelButton let doneButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.done, target: self, action: #selector(EPSignatureViewController.onTouchDoneButton)) - doneButton.tintColor = tintColor +// doneButton.tintColor = tintColor let clearButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.trash, target: self, action: #selector(EPSignatureViewController.onTouchClearButton)) - clearButton.tintColor = tintColor +// clearButton.tintColor = tintColor if showsDate { let dateFormatter = DateFormatter() @@ -60,7 +60,7 @@ open class EPSignatureViewController: UIViewController { if showsSaveSignatureOption { let actionButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.action, target: self, action: #selector(EPSignatureViewController.onTouchActionButton(_:))) - actionButton.tintColor = tintColor +// actionButton.tintColor = tintColor self.navigationItem.rightBarButtonItems = [doneButton, clearButton, actionButton] switchSaveSignature.onTintColor = tintColor } else { From b28382088c7ff80ee2871c16198ff160ac616356 Mon Sep 17 00:00:00 2001 From: Eryk Mariankowski Date: Wed, 16 Jan 2019 15:07:05 +0100 Subject: [PATCH 6/8] 004535 eSoftra iOS uwagi po prezentacji --- Pod/Classes/EPSignatureView.swift | 19 +++++++++++++------ Pod/Classes/EPSignatureViewController.swift | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Pod/Classes/EPSignatureView.swift b/Pod/Classes/EPSignatureView.swift index b036a4d..df5cb4e 100644 --- a/Pod/Classes/EPSignatureView.swift +++ b/Pod/Classes/EPSignatureView.swift @@ -116,10 +116,17 @@ open class EPSignatureView: UIView { /** scales and repositions the path */ open func reposition() { - var ratio = min(self.bounds.width / bezierPath.bounds.width, 1) - ratio = min((self.bounds.height - 64) / bezierPath.bounds.height, ratio) - bezierPath.apply(CGAffineTransform(scaleX: ratio, y: ratio)) - setNeedsDisplay() + if !bezierPath.isEmpty { + var ratio = min(self.bounds.width / bezierPath.bounds.width, 1) + ratio = min((self.bounds.height - 64) / bezierPath.bounds.height, ratio) + bezierPath.apply(CGAffineTransform(scaleX: ratio, y: ratio)) + let midX = (self.bounds.width - bezierPath.bounds.width) / 2 + let midY = (self.bounds.height - bezierPath.bounds.height) / 2 + let translateX = -bezierPath.bounds.origin.x + midX + let translateY = -bezierPath.bounds.origin.y + midY + bezierPath.apply(CGAffineTransform(translationX: translateX, y: translateY)) + setNeedsDisplay() + } } /** Returns the drawn path as Image. Adding subview to this view will also get returned in this image. @@ -137,7 +144,7 @@ open class EPSignatureView: UIView { /** Returns the rect of signature image drawn in the canvas. This can very very useful in croping out the unwanted empty areas in the signature image returned. */ - + open func getSignatureBoundsInCanvas() -> CGRect { return bezierPath.bounds } @@ -149,7 +156,7 @@ open class EPSignatureView: UIView { NSKeyedArchiver.archiveRootObject(bezierPath, toFile: localPath) } } - + open func loadSignature(_ filePath: String) { if let path = getPath(filePath) { isSigned = true diff --git a/Pod/Classes/EPSignatureViewController.swift b/Pod/Classes/EPSignatureViewController.swift index dd58bc8..8f41c79 100644 --- a/Pod/Classes/EPSignatureViewController.swift +++ b/Pod/Classes/EPSignatureViewController.swift @@ -24,7 +24,7 @@ open class EPSignatureViewController: UIViewController { @IBOutlet public weak var lblDefaultSignature: UILabel! @IBOutlet weak var lblDate: UILabel! @IBOutlet weak var viewMargin: UIView! - @IBOutlet weak var lblX: UILabel! + @IBOutlet public weak var lblX: UILabel! @IBOutlet public weak var signatureView: EPSignatureView! // MARK: - Public Vars From 6eedca3da8a91244a467378f7c3978a54ef16fd5 Mon Sep 17 00:00:00 2001 From: Eryk Mariankowski Date: Wed, 5 Feb 2020 15:22:39 +0100 Subject: [PATCH 7/8] =?UTF-8?q?004773=20Deployment=20target=2011.4,=20Nowa?= =?UTF-8?q?=20eureka=20i=20nowy=20realm=20(poprawa=20warning=C3=B3w),=20Da?= =?UTF-8?q?rk=20mode=20gotowy,=20wylogowanie=20na=20przedawnionym=20Tokeni?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pod/Classes/EPSignatureView.swift | 8 +++++++- Pod/Classes/EPSignatureViewController.xib | 16 ++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Pod/Classes/EPSignatureView.swift b/Pod/Classes/EPSignatureView.swift index df5cb4e..afccae1 100644 --- a/Pod/Classes/EPSignatureView.swift +++ b/Pod/Classes/EPSignatureView.swift @@ -17,8 +17,14 @@ open class EPSignatureView: UIView { fileprivate var bezierCounter : Int = 0 // MARK: - Public Vars + + open var strokeColor: UIColor { + if #available(iOS 13.0, *) { + return UIColor.label + } + return UIColor.black + } - open var strokeColor = UIColor.black open var strokeWidth: CGFloat = 2.0 { didSet { bezierPath.lineWidth = strokeWidth } } diff --git a/Pod/Classes/EPSignatureViewController.xib b/Pod/Classes/EPSignatureViewController.xib index 4734135..6c40c3d 100644 --- a/Pod/Classes/EPSignatureViewController.xib +++ b/Pod/Classes/EPSignatureViewController.xib @@ -1,11 +1,9 @@ - - - - + + - + @@ -29,11 +27,10 @@ - - + - From f1b0150c6f41bb0f9bdc587627ed121d7e17f31d Mon Sep 17 00:00:00 2001 From: Eryk Mariankowski Date: Tue, 4 May 2021 16:09:37 +0200 Subject: [PATCH 8/8] 006962 --- Pod/Classes/EPSignatureViewController.xib | 28 ++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Pod/Classes/EPSignatureViewController.xib b/Pod/Classes/EPSignatureViewController.xib index 6c40c3d..c90651b 100644 --- a/Pod/Classes/EPSignatureViewController.xib +++ b/Pod/Classes/EPSignatureViewController.xib @@ -1,9 +1,9 @@ - - + + - + @@ -23,20 +23,21 @@ - + - + + - + - + + + @@ -104,7 +107,6 @@ -