Guest User

Untitled

a guest
Jan 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. @objc func handleRecording(_ sender: RecordButton) {
  2. if recordButton.isRecording {
  3. audioView.isHidden = false
  4. UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: .curveEaseOut, animations: {
  5. self.handleView.alpha = 1
  6. self.timeLabel.alpha = 1
  7. self.audioView.alpha = 1
  8. self.view.frame = CGRect(x: 0, y: self.view.frame.height, width: self.view.bounds.width, height: -300)
  9. self.view.layoutIfNeeded()
  10. }, completion: nil)
  11. self.checkPermissionAndRecord()
  12. } else {
  13. audioView.isHidden = true
  14. UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: .curveEaseOut, animations: {
  15. self.handleView.alpha = 0
  16. self.timeLabel.alpha = 0
  17. self.audioView.alpha = 0
  18. self.view.frame = CGRect(x: 0, y: 0, width: self.view.bounds.width, height: 150)
  19. self.view.layoutIfNeeded()
  20. }, completion: nil)
  21. self.stopRecording()
  22. }
  23. }
Add Comment
Please, Sign In to add comment