Files
GitHawk/Classes/View Controllers/SplitViewControllerDelegate.swift
2017-07-09 11:18:05 -04:00

27 lines
765 B
Swift

//
// SplitViewControllerDelegate.swift
// Freetime
//
// Created by Ryan Nystrom on 6/25/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import UIKit
final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
func splitViewController(
_ splitViewController: UISplitViewController,
collapseSecondary secondaryViewController: UIViewController,
onto primaryViewController: UIViewController
) -> Bool {
// use an empty class to detect if displaying a placeholder VC as details
if let nav = secondaryViewController as? UINavigationController,
nav.viewControllers.first is SplitPlaceholderViewController {
return true
}
return false
}
}