diff --git a/.swift-version b/.swift-version deleted file mode 100644 index a3ec5a4..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -3.2 diff --git a/NumericKeyboard.podspec b/NumericKeyboard.podspec index fe4de5d..7c074ec 100644 --- a/NumericKeyboard.podspec +++ b/NumericKeyboard.podspec @@ -5,22 +5,24 @@ Pod::Spec.new do |s| s.name = 'NumericKeyboard' - s.version = '1.4.0' + s.version = '1.4.1' + s.swift_version = '5.0' s.summary = 'NumericKeyboard is a input view for UITextField & UITextView that shows a numeric entry keyboard on iPad.' s.description = <<-DESC This keyboard view is intended to replace the default keyboard on iPad for entering numerical values. As the default keyboard on iPad still shows all keys even for numerical entry modes, this keyboard only focuses on numeric keys. +This is a fork of https://github.com/marcjordant/NumericKeyboard fixing some issues with more current Xcode & Swift versions. DESC - s.homepage = 'https://github.com/marcjordant/NumericKeyboard' + s.homepage = 'https://github.com/Sevyls/NumericKeyboard' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Marc Jordant' => 'marcjordant@gmail.com' } - s.source = { :git => 'https://github.com/marcjordant/NumericKeyboard.git', :tag => s.version.to_s } + s.source = { git: 'https://github.com/Sevyls/NumericKeyboard.git', tag: s.version.to_s } s.screenshots = 'https://github.com/marcjordant/NumericKeyboard/blob/master/example.png?raw=true' s.social_media_url = 'https://twitter.com/marcjordant' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '11.4' s.source_files = 'NumericKeyboard/Classes/**/*' diff --git a/NumericKeyboard/Classes/NKInputView.swift b/NumericKeyboard/Classes/NKInputView.swift index 4ef7ca8..bc92cc8 100644 --- a/NumericKeyboard/Classes/NKInputView.swift +++ b/NumericKeyboard/Classes/NKInputView.swift @@ -196,7 +196,7 @@ open class NKInputView: UIView, UIInputViewAudioFeedback - important: Only affect the input view on iPad. Do nothing on iPhone or iPod */ - @discardableResult open static func with(_ textView: UITextInput, + @discardableResult public static func with(_ textView: UITextInput, type: NKKeyboardType = .decimalPad, returnKeyType: NKKeyboardReturnKeyType = .default) -> NKInputView? { @@ -251,7 +251,7 @@ open class NKInputView: UIView, UIInputViewAudioFeedback button?.returnType = .custom(text: title, actionButton: true) button?.isHidden = false - button?.addTarget(self, action: #selector(NKInputView.additionalButtonTouched(sender:)), for: UIControlEvents.touchUpInside) + button?.addTarget(self, action: #selector(NKInputView.additionalButtonTouched(sender:)), for: UIControl.Event.touchUpInside) } /** @@ -275,7 +275,7 @@ open class NKInputView: UIView, UIInputViewAudioFeedback } button?.isHidden = true - button?.removeTarget(nil, action: nil, for: UIControlEvents.touchUpInside) + button?.removeTarget(nil, action: nil, for: UIControl.Event.touchUpInside) } @@ -309,7 +309,7 @@ open class NKInputView: UIView, UIInputViewAudioFeedback bDot.isHidden = true } - bDot.setTitle((Locale.current as NSLocale).object(forKey: NSLocale.Key.decimalSeparator) as? String, for: UIControlState.normal) + bDot.setTitle((Locale.current as NSLocale).object(forKey: NSLocale.Key.decimalSeparator) as? String, for: UIControl.State.normal) } // Remove the Undo/Redo toolbar @@ -373,20 +373,20 @@ open class NKInputView: UIView, UIInputViewAudioFeedback textView?.insertText(char) if isTextField() { - NotificationCenter.default.post(name: NSNotification.Name.UITextFieldTextDidChange, object: self.textView) + NotificationCenter.default.post(name: UITextField.textDidChangeNotification, object: self.textView) } else if isTextView() { - NotificationCenter.default.post(name: NSNotification.Name.UITextViewTextDidChange, object: self.textView) + NotificationCenter.default.post(name: UITextField.textDidChangeNotification, object: self.textView) } case TAG_B_BACKWARD: textView?.deleteBackward() if isTextField() { - NotificationCenter.default.post(name: NSNotification.Name.UITextFieldTextDidChange, object: self.textView) + NotificationCenter.default.post(name: UITextField.textDidChangeNotification, object: self.textView) } else if isTextView() { - NotificationCenter.default.post(name: NSNotification.Name.UITextViewTextDidChange, object: self.textView) + NotificationCenter.default.post(name: UITextField.textDidChangeNotification, object: self.textView) } case TAG_B_RETURN: @@ -396,7 +396,7 @@ open class NKInputView: UIView, UIInputViewAudioFeedback } else if isTextView() { textView?.insertText("\n") - NotificationCenter.default.post(name: NSNotification.Name.UITextViewTextDidChange, object: self.textView) + NotificationCenter.default.post(name: UITextField.textDidChangeNotification, object: self.textView) } case TAG_B_DISMISS: diff --git a/NumericKeyboard/Classes/NKKeyboardButton.swift b/NumericKeyboard/Classes/NKKeyboardButton.swift index b1ab585..0401599 100644 --- a/NumericKeyboard/Classes/NKKeyboardButton.swift +++ b/NumericKeyboard/Classes/NKKeyboardButton.swift @@ -15,8 +15,8 @@ class NKKeyboardButton: UIButton var returnType = NKInputView.NKKeyboardReturnKeyType.default { didSet { - self.setTitle(returnType.text(), for: UIControlState()) - self.setTitleColor(returnType.textColor() ?? UIColor.black, for: UIControlState.normal) + self.setTitle(returnType.text(), for: UIControl.State()) + self.setTitleColor(returnType.textColor() ?? UIColor.black, for: UIControl.State.normal) self.backgroundColor = returnType.backgroundColor() ?? backgroundColorForStateNormal } }