This commit is contained in:
Max Hunt 2019-06-12 02:37:51 +01:00
parent d4b09461b3
commit 2b6b0989b4

View File

@ -28,14 +28,16 @@ class InstructionsViewController: UIViewController {
@IBAction func easterEggPressed(_ sender: Any) { @IBAction func easterEggPressed(_ sender: Any) {
self.separator.isHidden = true self.separator.isHidden = true
self.separator.alpha = 0.0
UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .green}) UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .green})
DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .red})} DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .red})}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) {UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .blue})} DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .blue})}
DispatchQueue.main.asyncAfter(deadline: .now() + 1.2) {UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .yellow})} DispatchQueue.main.asyncAfter(deadline: .now() + 1.2) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .yellow})}
DispatchQueue.main.asyncAfter(deadline: .now() + 1.6) {UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .cyan})} DispatchQueue.main.asyncAfter(deadline: .now() + 1.6) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .cyan})}
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .magenta})} DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .magenta})}
DispatchQueue.main.asyncAfter(deadline: .now() + 2.4) {UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .white})} DispatchQueue.main.asyncAfter(deadline: .now() + 2.4) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .white})}
self.separator.isHidden = false self.separator.isHidden = false
self.separator.alpha = 1.0
} }