mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-04-23 19:50:19 +08:00
restore system color divider line for ipad (#1989)
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// AppSplitViewController.swift
|
||||
// Freetime
|
||||
//
|
||||
// Created by Ryan Nystrom on 4/14/18.
|
||||
// Copyright © 2018 Ryan Nystrom. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
final class AppSplitViewController: UISplitViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
view.backgroundColor = .white
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,12 @@ 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(
|
||||
@@ -19,6 +25,8 @@ final class SplitViewControllerDelegate: UISplitViewControllerDelegate {
|
||||
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 {
|
||||
@@ -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 }
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 */; };
|
||||
@@ -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>"; };
|
||||
@@ -1661,7 +1659,6 @@
|
||||
297AE8681EC0D5C200B44A1F /* View Controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2950AB1A2082E47200C6F19A /* AppSplitViewController.swift */,
|
||||
29CEA5CC1F84DB1B009827DB /* BaseListViewController.swift */,
|
||||
29C8F9AA208BF64D0075931C /* BaseListViewController2.swift */,
|
||||
2973E80C20FBD7BF0050233F /* ContrastContextMenu.swift */,
|
||||
@@ -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 */,
|
||||
|
||||
@@ -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>
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user