From 0d7d2daccef0e8c97b6ffe9ed5089c3dc20b383c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Nemec=CC=8Cek?= Date: Sun, 29 Oct 2017 17:24:44 +0100 Subject: [PATCH 1/2] Add @objc for Swift 4 compatibility --- KeyboardController/Classes/KeyboardController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/KeyboardController/Classes/KeyboardController.swift b/KeyboardController/Classes/KeyboardController.swift index 897e955..90efe97 100644 --- a/KeyboardController/Classes/KeyboardController.swift +++ b/KeyboardController/Classes/KeyboardController.swift @@ -254,7 +254,7 @@ extension KeyboardController: KeyboardNotificationHandling { - author: Michal Konturek */ - public func onKeyboardDidHide() { + @objc public func onKeyboardDidHide() { self.delegate?.onKeyboardDidHide() } @@ -263,7 +263,7 @@ extension KeyboardController: KeyboardNotificationHandling { - author: Michal Konturek */ - public func onKeyboardDidShow() { + @objc public func onKeyboardDidShow() { self.delegate?.onKeyboardDidShow() } @@ -272,7 +272,7 @@ extension KeyboardController: KeyboardNotificationHandling { - author: Michal Konturek */ - public func onKeyboardWillHide() { + @objc public func onKeyboardWillHide() { self.delegate?.onKeyboardWillHide() } @@ -281,7 +281,7 @@ extension KeyboardController: KeyboardNotificationHandling { - author: Michal Konturek */ - public func onKeyboardWillShow() { + @objc public func onKeyboardWillShow() { self.delegate?.onKeyboardWillShow() } } From b8b2356e855549f91478dca577be98ff8ec77875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Nemec=CC=8Cek?= Date: Wed, 11 Sep 2019 12:01:37 +0200 Subject: [PATCH 2/2] Update for Swift 4.2 syntax --- KeyboardController/Classes/KeyboardController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/KeyboardController/Classes/KeyboardController.swift b/KeyboardController/Classes/KeyboardController.swift index 90efe97..1c8c3cd 100644 --- a/KeyboardController/Classes/KeyboardController.swift +++ b/KeyboardController/Classes/KeyboardController.swift @@ -132,19 +132,19 @@ public class KeyboardController: NSObject { let center = self.notificationCenter center.addObserver(self, selector: #selector(onKeyboardDidHide), - name: Notification.Name.UIKeyboardDidHide, + name: UIResponder.keyboardDidHideNotification, object: nil) center.addObserver(self, selector: #selector(onKeyboardDidShow), - name: Notification.Name.UIKeyboardDidShow, + name: UIResponder.keyboardDidShowNotification, object: nil) center.addObserver(self, selector: #selector(onKeyboardWillHide), - name: Notification.Name.UIKeyboardWillHide, + name: UIResponder.keyboardWillHideNotification, object: nil) center.addObserver(self, selector: #selector(onKeyboardWillShow), - name: Notification.Name.UIKeyboardWillShow, + name: UIResponder.keyboardWillShowNotification, object: nil) }