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.
set uiscreenedgepangesturerecognizer bottom edge, uipangesturerecognizer hiding keyboard in storyboard , drag @ibaction outlets code.
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.
in gesture actions when dragging animate view movement.
when stopped dragging need check view's position , animate destination if it's not there yet.
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
Post a Comment