Skip to content

Commit

Permalink
Merge pull request #7 from cats-oss/rotation-size
Browse files Browse the repository at this point in the history
Adds condition
  • Loading branch information
shoheiyokoyama authored Apr 30, 2020
2 parents fa63cc5 + 3306760 commit ace861c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Chausie/PageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public final class PageViewController: UIViewController {
public override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)

guard scrollView.bounds.width > 0 else { return }
guard viewIfLoaded?.window != nil && scrollView.bounds.width > 0 else { return }

isTransitioning = true

Expand Down
2 changes: 2 additions & 0 deletions ChausieTests/Tests/PageViewControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ private final class PageViewControllerTests: XCTestCase {
}

func testViewFrameAfterRotation() {
let window = UIWindow()
window.addSubview(pageViewController.view)
let currentSize = pageViewController.view.bounds.size
let newSize = CGSize(width: currentSize.height, height: currentSize.width)

Expand Down

0 comments on commit ace861c

Please sign in to comment.