Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions Classes/View Controllers/AppSplitViewController.swift

This file was deleted.

10 changes: 10 additions & 0 deletions Classes/View Controllers/SplitViewControllerDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ import UIKit
// detail VCs from primary on split VC expansion
protocol PrimaryViewController {}

private func fixBackground(for splitViewController: UISplitViewController, collapsing: Bool) {
splitViewController.view.backgroundColor = collapsing
? .white
: Styles.Colors.splitViewBackground
}

final class SplitViewControllerDelegate: UISplitViewControllerDelegate {

func splitViewController(
_ splitViewController: UISplitViewController,
collapseSecondary secondaryViewController: UIViewController,
onto primaryViewController: UIViewController
) -> Bool {
fixBackground(for: splitViewController, collapsing: true)

if let tab = primaryViewController as? UITabBarController,
let primaryNav = tab.selectedViewController as? UINavigationController,
let secondaryNav = secondaryViewController as? UINavigationController {
Expand All @@ -37,6 +45,8 @@ final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
_ splitViewController: UISplitViewController,
separateSecondaryFrom primaryViewController: UIViewController
) -> UIViewController? {
fixBackground(for: splitViewController, collapsing: false)

guard let tab = primaryViewController as? UITabBarController,
let primaryNav = tab.selectedViewController as? UINavigationController
else { return nil }
Expand Down
1 change: 1 addition & 0 deletions Classes/Views/Styles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ enum Styles {
static let purple = "6f42c1"
static let blueGray = "8697af"
static let menuBackgroundColor = "292D35"
static let splitViewBackground = UIColor(red: 0.556863, green: 0.556863, blue: 0.576471, alpha: 1)

enum Red {
static let medium = "cb2431"
Expand Down
4 changes: 0 additions & 4 deletions Freetime.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
294EE4CB209006C2002C9CB1 /* InboxController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 294EE4CA209006C2002C9CB1 /* InboxController.swift */; };
294EE4D1209006C3002C9CB1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 294EE4D0209006C3002C9CB1 /* Assets.xcassets */; };
294EE4D5209006C3002C9CB1 /* FreetimeWatch.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 294EE4B9209006BF002C9CB1 /* FreetimeWatch.app */; };
2950AB1B2082E47200C6F19A /* AppSplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2950AB1A2082E47200C6F19A /* AppSplitViewController.swift */; };
2950AB1D2083B1E400C6F19A /* EmptyLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2950AB1C2083B1E400C6F19A /* EmptyLoadingView.swift */; };
2957777B200129EB00DDD785 /* Int+Abbreviated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2957777A200129EB00DDD785 /* Int+Abbreviated.swift */; };
295840651EE89F28007723C6 /* IssueStatusEventModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295840641EE89F28007723C6 /* IssueStatusEventModel.swift */; };
Expand Down Expand Up @@ -689,7 +688,6 @@
294EE4CA209006C2002C9CB1 /* InboxController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxController.swift; sourceTree = "<group>"; };
294EE4D0209006C3002C9CB1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
294EE4D2209006C3002C9CB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2950AB1A2082E47200C6F19A /* AppSplitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSplitViewController.swift; sourceTree = "<group>"; };
2950AB1C2083B1E400C6F19A /* EmptyLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyLoadingView.swift; sourceTree = "<group>"; };
2957777A200129EB00DDD785 /* Int+Abbreviated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Int+Abbreviated.swift"; sourceTree = "<group>"; };
295840641EE89F28007723C6 /* IssueStatusEventModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IssueStatusEventModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1661,7 +1659,6 @@
297AE8681EC0D5C200B44A1F /* View Controllers */ = {
isa = PBXGroup;
children = (
2950AB1A2082E47200C6F19A /* AppSplitViewController.swift */,
29CEA5CC1F84DB1B009827DB /* BaseListViewController.swift */,
29C8F9AA208BF64D0075931C /* BaseListViewController2.swift */,
2973E80C20FBD7BF0050233F /* ContrastContextMenu.swift */,
Expand Down Expand Up @@ -3011,7 +3008,6 @@
29242814210A51B5001F5980 /* SpacerSectionController.swift in Sources */,
2971722B1F069E6B005E43AC /* SpinnerSectionController.swift in Sources */,
2999972E203120E300995FFD /* IssueMergeButtonCell.swift in Sources */,
2950AB1B2082E47200C6F19A /* AppSplitViewController.swift in Sources */,
2993046B1FBA8C04007B9737 /* IssueManagingExpansionCell.swift in Sources */,
29C33FDB1F127DBB00EC8D40 /* SplitPlaceholderViewController.swift in Sources */,
2924C18320D5B2BF00FCFCFF /* MilestoneCell.swift in Sources */,
Expand Down
6 changes: 3 additions & 3 deletions Resources/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="EPN-4V-9Hj">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="EPN-4V-9Hj">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
Expand Down Expand Up @@ -92,10 +92,10 @@
</objects>
<point key="canvasLocation" x="167" y="1321"/>
</scene>
<!--App Split View Controller-->
<!--Split View Controller-->
<scene sceneID="0c8-No-DSu">
<objects>
<splitViewController id="EPN-4V-9Hj" customClass="AppSplitViewController" customModule="Freetime" customModuleProvider="target" sceneMemberID="viewController">
<splitViewController id="EPN-4V-9Hj" sceneMemberID="viewController">
<connections>
<segue destination="f5k-7G-hod" kind="relationship" relationship="masterViewController" id="aFN-Se-rpt"/>
<segue destination="D4E-Yy-PTN" kind="relationship" relationship="detailViewController" id="gsk-8r-3gM"/>
Expand Down