iOS Interactive Keyboard Reveal -


on facebook messenger ios, has if keyboard hidden, if swipe up, keyboard show. in reverse interactive keyboard dismissal mode: keyboard reveals swipe @ speed in swipe up.

does have pointers on how this?

edit: answers! looking whether there built-in way this, since saw being done in facebook messenger. however, read blog post said had screenshot system keyboard effect—so i’ll assume there’s no built-in way this! mentioned in comments, i’m using custom keyboard, should lot easier, since have control on frame!

basically you'll need uipangesturerecognizer.

  1. set uiscreenedgepangesturerecognizer bottom edge, uipangesturerecognizer hiding keyboard in storyboard , drag @ibaction outlets code.

  2. set keyboard view container keyboard in bottom of controller in storyboard, user doesn't see it. drag @iboutlet code you'll able modify it's frame.

  3. in gesture actions when dragging animate view movement.

  4. when stopped dragging need check view's position , animate destination if it's not there yet.

  5. also you'll need add check dragging area user cannot drag further.

it's simple, you'll need check cases , test properly.

this basic setup can build this:

class viewcontroller: uiviewcontroller {      @iboutlet weak var keyboardcontainerview: uiview!      override func viewdidload() {         super.viewdidload()     }      @ibaction func onedgepangesturedrag(_ sender: uiscreenedgepangesturerecognizer) {         let point = sender.location(in: view)          view.layoutifneeded()         uiview.animate(withduration: 0.33) {             // animate custom keyboard view's position             self.keyboardcontainerview.frame = cgrect(x: self.keyboardcontainerview.bounds.origin.x,                                                       y: point.y,                                                       width: self.keyboardcontainerview.bounds.width,                                                       height: self.keyboardcontainerview.bounds.height)         }         view.layoutifneeded()     }      @ibaction func onpangesturedrag(_ sender: uipangesturerecognizer) {         let point = sender.location(in: view)          view.layoutifneeded()         uiview.animate(withduration: 0.33) {             // animate custom keyboard view's position             self.keyboardcontainerview.frame = cgrect(x: self.keyboardcontainerview.bounds.origin.x,                                                       y: point.y,                                                       width: self.keyboardcontainerview.bounds.width,                                                       height: self.keyboardcontainerview.bounds.height)         }         view.layoutifneeded()     } } 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -