Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit b37db3a

Browse files
authored
restore system color divider line for ipad (#1989)
1 parent 4d0644e commit b37db3a

File tree

5 files changed

+14
-25
lines changed

5 files changed

+14
-25
lines changed

Classes/View Controllers/AppSplitViewController.swift

Lines changed: 0 additions & 18 deletions
This file was deleted.

Classes/View Controllers/SplitViewControllerDelegate.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ import UIKit
1212
// detail VCs from primary on split VC expansion
1313
protocol PrimaryViewController {}
1414

15+
private func fixBackground(for splitViewController: UISplitViewController, collapsing: Bool) {
16+
splitViewController.view.backgroundColor = collapsing
17+
? .white
18+
: Styles.Colors.splitViewBackground
19+
}
20+
1521
final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
1622

1723
func splitViewController(
1824
_ splitViewController: UISplitViewController,
1925
collapseSecondary secondaryViewController: UIViewController,
2026
onto primaryViewController: UIViewController
2127
) -> Bool {
28+
fixBackground(for: splitViewController, collapsing: true)
29+
2230
if let tab = primaryViewController as? UITabBarController,
2331
let primaryNav = tab.selectedViewController as? UINavigationController,
2432
let secondaryNav = secondaryViewController as? UINavigationController {
@@ -37,6 +45,8 @@ final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
3745
_ splitViewController: UISplitViewController,
3846
separateSecondaryFrom primaryViewController: UIViewController
3947
) -> UIViewController? {
48+
fixBackground(for: splitViewController, collapsing: false)
49+
4050
guard let tab = primaryViewController as? UITabBarController,
4151
let primaryNav = tab.selectedViewController as? UINavigationController
4252
else { return nil }

Classes/Views/Styles.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ enum Styles {
8989
static let purple = "6f42c1"
9090
static let blueGray = "8697af"
9191
static let menuBackgroundColor = "292D35"
92+
static let splitViewBackground = UIColor(red: 0.556863, green: 0.556863, blue: 0.576471, alpha: 1)
9293

9394
enum Red {
9495
static let medium = "cb2431"

Freetime.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@
181181
294EE4CB209006C2002C9CB1 /* InboxController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 294EE4CA209006C2002C9CB1 /* InboxController.swift */; };
182182
294EE4D1209006C3002C9CB1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 294EE4D0209006C3002C9CB1 /* Assets.xcassets */; };
183183
294EE4D5209006C3002C9CB1 /* FreetimeWatch.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 294EE4B9209006BF002C9CB1 /* FreetimeWatch.app */; };
184-
2950AB1B2082E47200C6F19A /* AppSplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2950AB1A2082E47200C6F19A /* AppSplitViewController.swift */; };
185184
2950AB1D2083B1E400C6F19A /* EmptyLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2950AB1C2083B1E400C6F19A /* EmptyLoadingView.swift */; };
186185
2957777B200129EB00DDD785 /* Int+Abbreviated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2957777A200129EB00DDD785 /* Int+Abbreviated.swift */; };
187186
295840651EE89F28007723C6 /* IssueStatusEventModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295840641EE89F28007723C6 /* IssueStatusEventModel.swift */; };
@@ -689,7 +688,6 @@
689688
294EE4CA209006C2002C9CB1 /* InboxController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxController.swift; sourceTree = "<group>"; };
690689
294EE4D0209006C3002C9CB1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
691690
294EE4D2209006C3002C9CB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
692-
2950AB1A2082E47200C6F19A /* AppSplitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSplitViewController.swift; sourceTree = "<group>"; };
693691
2950AB1C2083B1E400C6F19A /* EmptyLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyLoadingView.swift; sourceTree = "<group>"; };
694692
2957777A200129EB00DDD785 /* Int+Abbreviated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Int+Abbreviated.swift"; sourceTree = "<group>"; };
695693
295840641EE89F28007723C6 /* IssueStatusEventModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IssueStatusEventModel.swift; sourceTree = "<group>"; };
@@ -1661,7 +1659,6 @@
16611659
297AE8681EC0D5C200B44A1F /* View Controllers */ = {
16621660
isa = PBXGroup;
16631661
children = (
1664-
2950AB1A2082E47200C6F19A /* AppSplitViewController.swift */,
16651662
29CEA5CC1F84DB1B009827DB /* BaseListViewController.swift */,
16661663
29C8F9AA208BF64D0075931C /* BaseListViewController2.swift */,
16671664
2973E80C20FBD7BF0050233F /* ContrastContextMenu.swift */,
@@ -3011,7 +3008,6 @@
30113008
29242814210A51B5001F5980 /* SpacerSectionController.swift in Sources */,
30123009
2971722B1F069E6B005E43AC /* SpinnerSectionController.swift in Sources */,
30133010
2999972E203120E300995FFD /* IssueMergeButtonCell.swift in Sources */,
3014-
2950AB1B2082E47200C6F19A /* AppSplitViewController.swift in Sources */,
30153011
2993046B1FBA8C04007B9737 /* IssueManagingExpansionCell.swift in Sources */,
30163012
29C33FDB1F127DBB00EC8D40 /* SplitPlaceholderViewController.swift in Sources */,
30173013
2924C18320D5B2BF00FCFCFF /* MilestoneCell.swift in Sources */,

Resources/Base.lproj/Main.storyboard

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<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">
2+
<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">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
@@ -92,10 +92,10 @@
9292
</objects>
9393
<point key="canvasLocation" x="167" y="1321"/>
9494
</scene>
95-
<!--App Split View Controller-->
95+
<!--Split View Controller-->
9696
<scene sceneID="0c8-No-DSu">
9797
<objects>
98-
<splitViewController id="EPN-4V-9Hj" customClass="AppSplitViewController" customModule="Freetime" customModuleProvider="target" sceneMemberID="viewController">
98+
<splitViewController id="EPN-4V-9Hj" sceneMemberID="viewController">
9999
<connections>
100100
<segue destination="f5k-7G-hod" kind="relationship" relationship="masterViewController" id="aFN-Se-rpt"/>
101101
<segue destination="D4E-Yy-PTN" kind="relationship" relationship="detailViewController" id="gsk-8r-3gM"/>

0 commit comments

Comments
 (0)