Skip to content

Instantly share code, notes, and snippets.

@zuchmanski
Last active December 15, 2015 23:19
Show Gist options
  • Save zuchmanski/5339397 to your computer and use it in GitHub Desktop.
Save zuchmanski/5339397 to your computer and use it in GitHub Desktop.
App.notification_center.observe UIKeyboardWillShowNotification do |notification|
UIView.beginAnimations(nil, context:nil)
UIView.setAnimationDuration(0.25)
frame = @save.frame
frame.origin.y = self.view.frame.size.height - 255.0
frame.size.height = 35
@save.frame = frame
frame = @delete.frame
frame.origin.y = self.view.frame.size.height - 255.0
frame.size.height = 35
@delete.frame = frame
frame = @content.frame
frame.size.height = 155
@content.frame = frame
frame = @bottomBorder.frame
frame.origin.y = self.view.frame.size.height - 260.0
@bottomBorder.frame = frame
UIView.commitAnimations
end
App.notification_center.observe UIKeyboardWillHideNotification do |notification|
UIView.beginAnimations(nil, context:nil)
UIView.setAnimationDuration(0.25)
frame = @save.frame
frame.origin.y = self.view.frame.size.height - 55.0
frame.size.height = 45
@save.frame = frame
frame = @delete.frame
frame.origin.y = self.view.frame.size.height - 55.0
frame.size.height = 45
@delete.frame = frame
frame = @content.frame
frame.size.height = 347
@content.frame = frame
frame = @bottomBorder.frame
frame.origin.y = self.view.frame.size.height - 68
@bottomBorder.frame = frame
UIView.commitAnimations
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment