Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @objc func handleRecording(_ sender: RecordButton) {
- if recordButton.isRecording {
- audioView.isHidden = false
- UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: .curveEaseOut, animations: {
- self.handleView.alpha = 1
- self.timeLabel.alpha = 1
- self.audioView.alpha = 1
- self.view.frame = CGRect(x: 0, y: self.view.frame.height, width: self.view.bounds.width, height: -300)
- self.view.layoutIfNeeded()
- }, completion: nil)
- self.checkPermissionAndRecord()
- } else {
- audioView.isHidden = true
- UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: .curveEaseOut, animations: {
- self.handleView.alpha = 0
- self.timeLabel.alpha = 0
- self.audioView.alpha = 0
- self.view.frame = CGRect(x: 0, y: 0, width: self.view.bounds.width, height: 150)
- self.view.layoutIfNeeded()
- }, completion: nil)
- self.stopRecording()
- }
- }
Add Comment
Please, Sign In to add comment