Skip to content

Instantly share code, notes, and snippets.

@JillevdW
Last active July 6, 2018 23:48
Show Gist options
  • Save JillevdW/d790d731625e07f87e3c4cb546df2948 to your computer and use it in GitHub Desktop.
Save JillevdW/d790d731625e07f87e3c4cb546df2948 to your computer and use it in GitHub Desktop.
phone check
if UIScreen.main.bounds.height < 812 {
UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 100, initialSpringVelocity: 30, options: [.curveEaseOut, .allowUserInteraction], animations: {
self.frame.origin = nearestCornerPosition
}, completion: nil)
} else {
UIView.animate(withDuration: 1, delay: 0, usingSpringWithDamping: 100, initialSpringVelocity: 10, options: [.curveEaseOut, .allowUserInteraction], animations: {
self.frame.origin = nearestCornerPosition
}, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment