Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Pod/Classes/EPExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions Pod/Classes/EPSignatureViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down