LoginSignup
0
0

More than 5 years have passed since last update.

Swiftで困っときに見るもの(音の取得と、アニメーションの設定)

Posted at

音データを取得して表示させる

if SoundPlayServive.shared.isPlaying {
                        let plyersSelect: [Sound] = SoundPlayServive.shared.playingSounds
                        plyersSelect.forEach { selectPlyer in
                            print("\(selectPlyer.title)-\(selectPlyer.id): \(SoundPlayServive.shared.getVolume(with: selectPlyer.id))")
                        }
                    }

アニメーションの設定

//ボタンを揺らすアニメーション
                UIView.animate(withDuration: 0.2, animations: {
                    self?.bookStatusButton.transform = CGAffineTransform(scaleX: 1.2, y: 1.2)
                }, completion: { _ in
                    UIView.animate(withDuration: 0.2) {
                        self?.bookStatusButton.transform = CGAffineTransform.identity
                    }
                })

参考:https://slack-redir.net/link?url=https%3A%2F%2Fqiita.com%2Fhayashi311%2Fitems%2F953d3282c6ffebf308df

                   UIView.animate(withDuration: 1.0, delay: 0.0, options: .curveEaseOut, animations: {
                        self.soundControlViews.frame = CGRect(x: soudViewsFrame.origin.x, y: soudViewsFrame.origin.y, width: soudViewsBounds.width, height : soudViewsBounds.height + addHights)
                        }, completion: nil)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0