Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 4.2 #1

Merged
merged 2 commits into from
Oct 1, 2018
Merged
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 .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: objective-c #1
osx_image: xcode9.3 #2
xcode_workspace: Example/EPSignature.xcworkspace #3
xcode_scheme: EPSignature #4
xcode_scheme: EPSignature-Example #4
xcode_sdk: iphonesimulator10.3 #5

before_install:
- xcodebuild -version
script:
Expand Down
16 changes: 8 additions & 8 deletions Example/EPSignature.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = DG779MAMM2;
LastSwiftMigration = 0900;
DevelopmentTeam = L74Y3RTC7X;
LastSwiftMigration = "";
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = DG779MAMM2;
LastSwiftMigration = 0900;
DevelopmentTeam = L74Y3RTC7X;
LastSwiftMigration = "";
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
Expand Down Expand Up @@ -516,7 +516,7 @@
baseConfigurationReference = 1CC0D063C0E6BB1DA5D21548 /* Pods-EPSignature_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = DG779MAMM2;
DEVELOPMENT_TEAM = L74Y3RTC7X;
INFOPLIST_FILE = EPSignature/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -533,7 +533,7 @@
baseConfigurationReference = EAC7FAB870C77D62CB94C285 /* Pods-EPSignature_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = DG779MAMM2;
DEVELOPMENT_TEAM = L74Y3RTC7X;
INFOPLIST_FILE = EPSignature/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -550,7 +550,7 @@
baseConfigurationReference = BADBD621301FD946BBB4C228 /* Pods-EPSignature_Tests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = DG779MAMM2;
DEVELOPMENT_TEAM = L74Y3RTC7X;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand All @@ -570,7 +570,7 @@
baseConfigurationReference = 0F8DB633D789A18A31700E0D /* Pods-EPSignature_Tests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = DG779MAMM2;
DEVELOPMENT_TEAM = L74Y3RTC7X;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand Down
6 changes: 3 additions & 3 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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: .alert)

// add an action (button)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
alert.addAction(UIAlertAction(title: "OK", 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: .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: .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: .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: .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: .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: .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: .destructive, handler: { action in
self.signatureView.removeSignature()
}))

action.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil))
action.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))

if let popOver = action.popoverPresentationController {
popOver.barButtonItem = barButton
Expand Down