Skip to content

Commit

Permalink
Better way of shutting off horizontal scrolling when we only have one…
Browse files Browse the repository at this point in the history
… account
  • Loading branch information
aydenp committed Dec 4, 2017
1 parent f4abc98 commit 6d63813
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Bank/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ class ViewController: UIPageViewController, UIPageViewControllerDataSource, NoAc
}
setViewControllers((SessionDataStorage.shared.accounts?.count ?? 0) > 0 ? [getViewController(for: 0)] : [getNoAccountsViewController()], direction: .forward, animated: false, completion: nil)
dataSource = nil
dataSource = self
isSwipingEnabled = SessionDataStorage.shared.accounts?.count ?? 0 > 1
// Only re-enable data source if we have more than one item (as no data source means no horizontal scrolling)
if SessionDataStorage.shared.accounts?.count ?? 0 > 1 {
dataSource = self
}
determineStatus()
}

Expand Down

0 comments on commit 6d63813

Please sign in to comment.