Skip to content

Commit

Permalink
add demo for disabling animations
Browse files Browse the repository at this point in the history
  • Loading branch information
icanzilb committed Sep 22, 2017
1 parent ac3e33b commit 3583d9c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Example/RxAnimated/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,15 @@ class ViewController: UIViewController {
.bind(to: labelIsHidden.rx.text)
.disposed(by: bag)

// disable animations when the device is working hard or user is motion sensitive
RxAnimated.enableDefaultPerformanceHeuristics()

//disable animations
// disable animations manually
DispatchQueue.main.asyncAfter(deadline: .now() + 10.0, execute: {
RxAnimated.areAnimationsEnabled.value = false
})
DispatchQueue.main.asyncAfter(deadline: .now() + 15.0, execute: {
RxAnimated.areAnimationsEnabled.value = true
})
}

}

0 comments on commit 3583d9c

Please sign in to comment.