Starts syncing after dismissing Settings with gesture
This commit is contained in:
parent
2c05e1b70f
commit
5c574f5ea3
@ -37,7 +37,7 @@
|
||||
<navigationItem key="navigationItem" title="Games" id="pFk-as-3k4">
|
||||
<barButtonItem key="leftBarButtonItem" image="SettingsButton" id="2gg-lC-FhX">
|
||||
<connections>
|
||||
<segue destination="xMK-Cs-fAS" kind="presentation" id="uN5-PN-7FK"/>
|
||||
<segue destination="xMK-Cs-fAS" kind="presentation" identifier="showSettings" id="uN5-PN-7FK"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<barButtonItem key="rightBarButtonItem" systemItem="add" id="FeA-O5-xd2">
|
||||
|
||||
@ -141,12 +141,22 @@ extension GamesViewController
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?)
|
||||
{
|
||||
guard let identifier = segue.identifier, identifier == "embedPageViewController" else { return }
|
||||
guard let identifier = segue.identifier else { return }
|
||||
|
||||
self.pageViewController = segue.destination as? UIPageViewController
|
||||
self.pageViewController.dataSource = self
|
||||
self.pageViewController.delegate = self
|
||||
self.pageViewController.view.isHidden = true
|
||||
switch identifier
|
||||
{
|
||||
case "embedPageViewController":
|
||||
self.pageViewController = segue.destination as? UIPageViewController
|
||||
self.pageViewController.dataSource = self
|
||||
self.pageViewController.delegate = self
|
||||
self.pageViewController.view.isHidden = true
|
||||
|
||||
case "showSettings":
|
||||
let destinationViewController = segue.destination
|
||||
destinationViewController.presentationController?.delegate = self
|
||||
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction private func unwindFromSettingsViewController(_ segue: UIStoryboardSegue)
|
||||
@ -542,3 +552,11 @@ extension GamesViewController: NSFetchedResultsControllerDelegate
|
||||
self.updateSections(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
extension GamesViewController: UIAdaptivePresentationControllerDelegate
|
||||
{
|
||||
func presentationControllerWillDismiss(_ presentationController: UIPresentationController)
|
||||
{
|
||||
self.sync()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user