Commit b14c3d0e authored by toby's avatar toby

use presentation layer

parent 50beeb01
......@@ -75,12 +75,11 @@ extension RootViewController: StateMachineDelegate {
case (.Ready, .AnimatingBackground), (.Finished, .AnimatingBackground):
animateBackground()
case (.AnimatingBackground, .PausedBackground):
pausedBackgroundColor = background.backgroundColor!
let prezLayer = background.layer.presentationLayer() as? CALayer
pausedBackgroundColor = UIColor(CGColor: prezLayer!.backgroundColor!)
background.pause()
case (.PausedBackground, .AnimatingBackground), (.PausedBackground, .Finished):
var n: UIColor?
n = nil
pausedBackgroundColor = n
case (.PausedBackground, .AnimatingBackground):
pausedBackgroundColor = nil
background.unpause()
case (.AnimatingBackground, .Finished):
machine.state = .AnimatingBackground
......@@ -117,6 +116,10 @@ class RootViewController: UIViewController {
override func viewWillAppear(animated: Bool) {
navigationController!.setNavigationBarHidden(true, animated: false)
println("unpause \(pausedBackgroundColor)")
if (pausedBackgroundColor != nil) {
println("show it")
}
}
override func loadView() {
......@@ -313,8 +316,8 @@ class RootViewController: UIViewController {
var colors = [UIColor]()
colors = blocks.map({ return $0.backgroundColor! })
colors += barriers.map({ return $0.backgroundColor! })
if pausedBackgroundColor != nil {
println("doing paused")
colors.append(pausedBackgroundColor!)
} else {
colors.append(background.backgroundColor!)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment