From 420b0df2af6833a69b50e64cabfeeb13624a3501 Mon Sep 17 00:00:00 2001 From: Diogo Guimaraes Date: Fri, 15 Apr 2016 18:49:06 +0100 Subject: [PATCH 1/2] Update selectors to Swift 2.2 --- PasscodeLock/PasscodeLockViewController.swift | 4 ++-- PasscodeLock/Views/PasscodeSignButton.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PasscodeLock/PasscodeLockViewController.swift b/PasscodeLock/PasscodeLockViewController.swift index 095f10f2..41e2f6ab 100644 --- a/PasscodeLock/PasscodeLockViewController.swift +++ b/PasscodeLock/PasscodeLockViewController.swift @@ -110,8 +110,8 @@ public class PasscodeLockViewController: UIViewController, PasscodeLockTypeDeleg private func setupEvents() { - notificationCenter?.addObserver(self, selector: "appWillEnterForegroundHandler:", name: UIApplicationWillEnterForegroundNotification, object: nil) - notificationCenter?.addObserver(self, selector: "appDidEnterBackgroundHandler:", name: UIApplicationDidEnterBackgroundNotification, object: nil) + notificationCenter?.addObserver(self, selector: #selector(PasscodeLockViewController.appWillEnterForegroundHandler(_:)), name: UIApplicationWillEnterForegroundNotification, object: nil) + notificationCenter?.addObserver(self, selector: #selector(PasscodeLockViewController.appDidEnterBackgroundHandler(_:)), name: UIApplicationDidEnterBackgroundNotification, object: nil) } private func clearEvents() { diff --git a/PasscodeLock/Views/PasscodeSignButton.swift b/PasscodeLock/Views/PasscodeSignButton.swift index 9fb3968a..be418cf1 100644 --- a/PasscodeLock/Views/PasscodeSignButton.swift +++ b/PasscodeLock/Views/PasscodeSignButton.swift @@ -71,8 +71,8 @@ public class PasscodeSignButton: UIButton { private func setupActions() { - addTarget(self, action: Selector("handleTouchDown"), forControlEvents: .TouchDown) - addTarget(self, action: Selector("handleTouchUp"), forControlEvents: [.TouchUpInside, .TouchDragOutside, .TouchCancel]) + addTarget(self, action: #selector(PasscodeSignButton.handleTouchDown), forControlEvents: .TouchDown) + addTarget(self, action: #selector(PasscodeSignButton.handleTouchUp), forControlEvents: [.TouchUpInside, .TouchDragOutside, .TouchCancel]) } func handleTouchDown() { From 898ac46b7dc8054d65284881adb636d45fd18baa Mon Sep 17 00:00:00 2001 From: Diogo Guimaraes Date: Fri, 15 Apr 2016 18:52:53 +0100 Subject: [PATCH 2/2] Improve customization access control --- PasscodeLock/PasscodeLockViewController.swift | 2 +- PasscodeLock/Views/PasscodeSignButton.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PasscodeLock/PasscodeLockViewController.swift b/PasscodeLock/PasscodeLockViewController.swift index 41e2f6ab..6b9fd481 100644 --- a/PasscodeLock/PasscodeLockViewController.swift +++ b/PasscodeLock/PasscodeLockViewController.swift @@ -154,7 +154,7 @@ public class PasscodeLockViewController: UIViewController, PasscodeLockTypeDeleg passcodeLock.authenticateWithBiometrics() } - private func authenticateWithBiometrics() { + public func authenticateWithBiometrics() { if passcodeConfiguration.shouldRequestTouchIDImmediately && passcodeLock.isTouchIDAllowed { diff --git a/PasscodeLock/Views/PasscodeSignButton.swift b/PasscodeLock/Views/PasscodeSignButton.swift index be418cf1..dfd9fe0c 100644 --- a/PasscodeLock/Views/PasscodeSignButton.swift +++ b/PasscodeLock/Views/PasscodeSignButton.swift @@ -55,7 +55,7 @@ public class PasscodeSignButton: UIButton { return CGSizeMake(60, 60) } - private var defaultBackgroundColor = UIColor.clearColor() + public var defaultBackgroundColor = UIColor.clearColor() private func setupView() {