summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN.xcodeproj/project.pbxproj4
-rw-r--r--ios/MullvadVPN/CustomSplitViewController.swift57
-rw-r--r--ios/MullvadVPN/UIColor+Palette.swift4
3 files changed, 65 insertions, 0 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj
index 5a496cf62f..133a2da18a 100644
--- a/ios/MullvadVPN.xcodeproj/project.pbxproj
+++ b/ios/MullvadVPN.xcodeproj/project.pbxproj
@@ -101,6 +101,7 @@
585FE2F124E1365400439C50 /* LogStreamer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 585FE2F024E1365400439C50 /* LogStreamer.swift */; };
5862805422428EF100F5A6E1 /* TranslucentButtonBlurView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5862805322428EF100F5A6E1 /* TranslucentButtonBlurView.swift */; };
5868585524054096000B8131 /* AppButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5868585424054096000B8131 /* AppButton.swift */; };
+ 5868BD33261DCD2600E6027F /* CustomSplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5868BD32261DCD2600E6027F /* CustomSplitViewController.swift */; };
586AA296234B696B00502875 /* WireguardAssociatedAddresses.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B8743122B25A7600015324 /* WireguardAssociatedAddresses.swift */; };
586BD68322B7BBD800BB7F9F /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 586BD68222B7BBD800BB7F9F /* NetworkExtension.framework */; };
586BD68422B7BBE400BB7F9F /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 586BD68222B7BBD800BB7F9F /* NetworkExtension.framework */; };
@@ -324,6 +325,7 @@
5862805322428EF100F5A6E1 /* TranslucentButtonBlurView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslucentButtonBlurView.swift; sourceTree = "<group>"; };
5866F39B2243B82D00168AE5 /* MullvadVPN.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MullvadVPN.entitlements; sourceTree = "<group>"; };
5868585424054096000B8131 /* AppButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppButton.swift; sourceTree = "<group>"; };
+ 5868BD32261DCD2600E6027F /* CustomSplitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSplitViewController.swift; sourceTree = "<group>"; };
586BD68222B7BBD800BB7F9F /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
5871FB8225498CA20051A0A4 /* Swizzle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swizzle.swift; sourceTree = "<group>"; };
5871FB95254ADE4E0051A0A4 /* ConsolidatedApplicationLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsolidatedApplicationLog.swift; sourceTree = "<group>"; };
@@ -648,6 +650,7 @@
583DA21325FA4B5C00318683 /* LocationDataSource.swift */,
58B993B02608A34500BA7811 /* LoginContentView.swift */,
58FEEB57260B662E00A621A8 /* AutomaticKeyboardResponder.swift */,
+ 5868BD32261DCD2600E6027F /* CustomSplitViewController.swift */,
);
path = MullvadVPN;
sourceTree = "<group>";
@@ -1042,6 +1045,7 @@
58293FAE2510CA58005D0BB5 /* ProblemReportViewController.swift in Sources */,
589AB4F7227B64450039131E /* BasicTableViewCell.swift in Sources */,
58B9EB152489139B00095626 /* DisplayChainedError.swift in Sources */,
+ 5868BD33261DCD2600E6027F /* CustomSplitViewController.swift in Sources */,
5888AD7F2279B6BF0051EB06 /* RelayStatusIndicatorView.swift in Sources */,
58CCA01E2242787B004F3011 /* AccountTextField.swift in Sources */,
587AD7CA2342283900E93A53 /* Account.swift in Sources */,
diff --git a/ios/MullvadVPN/CustomSplitViewController.swift b/ios/MullvadVPN/CustomSplitViewController.swift
new file mode 100644
index 0000000000..557c2f23d7
--- /dev/null
+++ b/ios/MullvadVPN/CustomSplitViewController.swift
@@ -0,0 +1,57 @@
+//
+// CustomSplitViewController.swift
+// MullvadVPN
+//
+// Created by pronebird on 07/04/2021.
+// Copyright © 2021 Mullvad VPN AB. All rights reserved.
+//
+
+import UIKit
+
+class CustomSplitViewController: UISplitViewController, RootContainment {
+
+ var preferredHeaderBarStyle: HeaderBarStyle {
+ for case let viewController as RootContainment in viewControllers {
+ return viewController.preferredHeaderBarStyle
+ }
+ return .default
+ }
+
+ var prefersHeaderBarHidden: Bool {
+ for case let viewController as RootContainment in viewControllers {
+ return viewController.prefersHeaderBarHidden
+ }
+ return false
+ }
+
+ var dividerColor: UIColor? {
+ didSet {
+ if isViewLoaded {
+ self.updateDividerColor()
+ }
+ }
+ }
+
+ override func viewDidLayoutSubviews() {
+ super.viewDidLayoutSubviews()
+
+ updateDividerColor()
+ }
+
+ private var dividerView: UIView? {
+ let subviews = view.subviews.flatMap { (view) -> [UIView] in
+ return [view] + view.subviews
+ }
+
+ return subviews.first { (view) -> Bool in
+ return view.description.hasPrefix("<UIPanelBorderView")
+ }
+ }
+
+ private func updateDividerColor() {
+ guard let dividerColor = dividerColor else { return }
+
+ dividerView?.backgroundColor = dividerColor
+ }
+
+}
diff --git a/ios/MullvadVPN/UIColor+Palette.swift b/ios/MullvadVPN/UIColor+Palette.swift
index f31f67c9fb..e2925af270 100644
--- a/ios/MullvadVPN/UIColor+Palette.swift
+++ b/ios/MullvadVPN/UIColor+Palette.swift
@@ -47,6 +47,10 @@ extension UIColor {
static let inactiveColor = dangerColor.withAlphaComponent(0.95)
}
+ enum MainSplitView {
+ static let dividerColor = UIColor.black
+ }
+
// Cells
enum Cell {
static let backgroundColor = primaryColor