IsaiasSantana / keyboard_utils

A Flutter plugin to check keyboard visibility.
MIT License
49 stars 49 forks source link

iOS compilation errors : Constants renamed #13

Closed Chralu closed 4 years ago

Chralu commented 4 years ago

Hello,

I use keyboard_utils v1.2.0 on a Flutter (kotlin/Swift) project.

On build, Xcode returns the following output :

Command CompileSwift failed with a nonzero exit code
    /.../flutter/.pub-cache/hosted/pub.dartlang.org/keyboard_utils-1.2.0/ios/Classes/SwiftKeyboardUtilsPlugin.swift:49:66: error: 'keyboardWillShowNotification' has been renamed to 'NSNotification.Name.UIKeyboardWillShow'
                                                   name: UIResponder.keyboardWillShowNotification,
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                     NSNotification.Name.UIKeyboardWillShow
    UIKit.UIResponder:3:22: note: 'keyboardWillShowNotification' was introduced in Swift 4.2
        public class let keyboardWillShowNotification: NSNotification.Name
                         ^
    /.../flutter/.pub-cache/hosted/pub.dartlang.org/keyboard_utils-1.2.0/ios/Classes/SwiftKeyboardUtilsPlugin.swift:54:66: error: 'keyboardWillHideNotification' has been renamed to 'NSNotification.Name.UIKeyboardWillHide'
                                                   name: UIResponder.keyboardWillHideNotification,
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                     NSNotification.Name.UIKeyboardWillHide
    UIKit.UIResponder:7:22: note: 'keyboardWillHideNotification' was introduced in Swift 4.2
        public class let keyboardWillHideNotification: NSNotification.Name
                         ^
    /.../flutter/.pub-cache/hosted/pub.dartlang.org/keyboard_utils-1.2.0/ios/Classes/SwiftKeyboardUtilsPlugin.swift:59:66: error: 'keyboardDidShowNotification' has been renamed to 'NSNotification.Name.UIKeyboardDidShow'
                                                   name: UIResponder.keyboardDidShowNotification,
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                     NSNotification.Name.UIKeyboardDidShow
    UIKit.UIResponder:5:22: note: 'keyboardDidShowNotification' was introduced in Swift 4.2
        public class let keyboardDidShowNotification: NSNotification.Name
                         ^
    /.../flutter/.pub-cache/hosted/pub.dartlang.org/keyboard_utils-1.2.0/ios/Classes/SwiftKeyboardUtilsPlugin.swift:73:80: error: 'keyboardFrameEndUserInfoKey' has been renamed to 'UIKeyboardFrameEndUserInfoKey'
                if let keyboardFrame: NSValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                   UIKeyboardFrameEndUserInfoKey
    UIKit.UIResponder:15:22: note: 'keyboardFrameEndUserInfoKey' was introduced in Swift 4.2
        public class let keyboardFrameEndUserInfoKey: String
Chralu commented 4 years ago

I'm trying to submit a fix ASAP.

Thanks for your work anyway :)

IsaiasSantana commented 4 years ago

Hi, @Chralu what is your swift project version?

Chralu commented 4 years ago

Hi @IsaiasSantana,

I was using Swift 4. There is no issue with Swift 5.

My bad XD