Skip to content

Possible to create example using Storyboard and AutoLayout? #90

@ghost

Description

Trying to use this control in a new app that requires Storyboard/Autolayout.
I see you added a 2nd block 'constraintBasedActionHandler' to each method, but I don't see any examples on how to properly use it.

I tried this but the message input view I have never moves:

        self.view.addKeyboardPanningWithFrameBasedActionHandler(nil, constraintBasedActionHandler: { [unowned self] (keyboardFrameInView, opening, closing) -> Void in
            //self.messageToolbar.bottomConstraint.constant = -keyboardFrameInView.size.height // Also tried this
            self.messageToolbar.bottomConstraint.constant = self.view.frame.size.height - keyboardFrameInView.size.height
            self.view.updateConstraintsIfNeeded()
            self.view.layoutIfNeeded()
        })

It does work when I set the frame manually and not use the auto layout constraint, but I am having to many issues with different devices and am trying to steer clear of setting frames directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions