Skip to content

Commit

Permalink
✨ スライドショー中はスリープしないように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tasuwo committed Aug 24, 2022
1 parent ac18dbe commit e8785bc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ class ClipPreviewPageViewController: UIPageViewController {
fatalError("init(coder:) has not been implemented")
}

deinit {
UIApplication.shared.isIdleTimerDisabled = false
}

// MARK: - View Life-Cycle Methods

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
Expand Down Expand Up @@ -216,6 +220,7 @@ extension ClipPreviewPageViewController {

store.state
.bind(\.playingAt) { [weak self] playingAt in
UIApplication.shared.isIdleTimerDisabled = playingAt != nil
self?.barController.store.execute(.updatedPlaying(playingAt != nil))
}
.store(in: &subscriptions)
Expand Down

0 comments on commit e8785bc

Please sign in to comment.