Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

keyboard.isEnabled didn't Trigger observe function #14

Closed
emre-yilmaz opened this issue Oct 3, 2017 · 2 comments
Closed

keyboard.isEnabled didn't Trigger observe function #14

emre-yilmaz opened this issue Oct 3, 2017 · 2 comments

Comments

@emre-yilmaz
Copy link
Contributor

I have UITextField and UIButton. I'm texing to the UItextfield and then pressing the submit button. but didn't trigger kerboard observe func.

Share button action :

  @IBAction func shareButtonPressed(_ sender: UIButton){
    shareButton.isEnabled = false
    self.keyboard.isEnabled = !self.keyboard.isEnabled 
    }

Have any solution?

@morizotter
Copy link
Owner

morizotter commented Oct 3, 2017

KeyboardObserver just observes the keyboard state changes. isEnabled changes whether observe or not.

I think you have to do is to resign textfield's responder.

Something like:

@IBAction func shareButtonPressed(_ sender: UIButton){
    shareButton.isEnabled = false
    // self.keyboard.isEnabled = !self.keyboard.isEnabled 
    textField.resignFirstResponder()
    }

@emre-yilmaz
Copy link
Contributor Author

Thanks your solution. It's running now 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants