Skip to content

HUD moves to accomodate keyboard #179

Open
MendyK wants to merge 6 commits intopkluz:masterfrom
MendyK:master
Open

HUD moves to accomodate keyboard #179
MendyK wants to merge 6 commits intopkluz:masterfrom
MendyK:master

Conversation

@MendyK
Copy link
Copy Markdown

@MendyK MendyK commented Jun 30, 2017

Until now the HUD would stay in the center of the screen, even when the keyboard was up.

My implementation makes it so that if the keyboard is up and HUD.flash() is called, the HUD moves to the center between the keyboard and the top of the container view.
if the HUD is on screen when the keyboard is popping up or down, the HUD will animate up and down in order to not block the keyboard.

@MendyK
Copy link
Copy Markdown
Author

MendyK commented Jun 30, 2017

Unit tests are passing. I'm not sure why the travis build is failing.

@PGLongo
Copy link
Copy Markdown
Collaborator

PGLongo commented Jul 1, 2017

Hi @MendyK and thanks for the PR. Can you add a screenshot and put an example in the demo project?

Don't worry about Travis, unfortunately there is a bug on Travis and some builds sometimes (very often) fail without any reason

@MendyK
Copy link
Copy Markdown
Author

MendyK commented Jul 4, 2017

@PGLongo I didn't want to change the current demo, so I made a new demo target. Is that okay?

@MendyK
Copy link
Copy Markdown
Author

MendyK commented Jul 4, 2017

Here are the screenshots

screenshotcheckmark
screenshotloading

@PGLongo
Copy link
Copy Markdown
Collaborator

PGLongo commented Jul 5, 2017

Please don't add a new demo target. Add an hidden textfield and a new button in the actual target

@PGLongo
Copy link
Copy Markdown
Collaborator

PGLongo commented Jul 5, 2017

There are two little problem with your implementation:

  1. If I don't want to move the HUD? IF I only want to show on top of the keyboard?
  2. If i change your demo code as follow your code doesn't work
 override func viewDidLoad() {
        super.viewDidLoad()
       // HUD.dimsBackground = false
        //HUD.allowsInteraction = true
    }

You can easily fix this two issue moving the registerForKeyboardNotifications outside the common init and force the user to register and then unregister

@MendyK
Copy link
Copy Markdown
Author

MendyK commented Jul 5, 2017

What do you mean by "force the user to register and then unregister"?

@PGLongo
Copy link
Copy Markdown
Collaborator

PGLongo commented Jul 5, 2017

Call something like PKHUD. registerForKeyboardNotifications only if you are interested in handling the keyboard

@MendyK
Copy link
Copy Markdown
Author

MendyK commented Jul 5, 2017

@PGLongo I also got rid of the keyboard demo target and added a hidden textfield to the demo project as you suggested

@MendyK
Copy link
Copy Markdown
Author

MendyK commented Jul 5, 2017

screenshot

@MendyK
Copy link
Copy Markdown
Author

MendyK commented Jul 12, 2017

@PGLongo Is there anything else I can do?

@PGLongo
Copy link
Copy Markdown
Collaborator

PGLongo commented Jul 26, 2017

Sorry for the delay @MendyK. Unfortunately I need more time for review and tests. I will try to merge this PR in the next two weeks

@PGLongo
Copy link
Copy Markdown
Collaborator

PGLongo commented Oct 7, 2017

@MendyK I'm deeply sorry for the delay. If you fix the conflict I will test and merge this PR.

Thanks

@MendyK
Copy link
Copy Markdown
Author

MendyK commented Jan 12, 2018

@PGLongo Sorry for the delay on my end. I fixed the conflict

@alexookah
Copy link
Copy Markdown
Contributor

what happened to this pull request? can this still be merged?

@alexookah
Copy link
Copy Markdown
Contributor

@PGLongo this pull request can now be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants