summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift
diff options
context:
space:
mode:
authorJon Petersson <jon.petersson@mullvad.net>2026-02-27 16:25:03 +0100
committerJon Petersson <jon.petersson@mullvad.net>2026-02-27 16:25:03 +0100
commit6676acf301c498a8dcb71a35f409b89968b3a750 (patch)
treed59d5398b6a3d03f2e2b04498e02d2546610ea3f /ios/MullvadVPN/Containers/Root/RootContainerViewController.swift
parentfe84f9bad91e222ed768ede172fce1e2ada29bea (diff)
downloadmullvadvpn-debug-view.tar.xz
mullvadvpn-debug-view.zip
Add debug viewdebug-view
Diffstat (limited to 'ios/MullvadVPN/Containers/Root/RootContainerViewController.swift')
-rw-r--r--ios/MullvadVPN/Containers/Root/RootContainerViewController.swift28
1 files changed, 28 insertions, 0 deletions
diff --git a/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift b/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift
index e735264a29..680e08bbaf 100644
--- a/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift
+++ b/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift
@@ -62,6 +62,11 @@ extension RootContainment {
}
protocol RootContainerViewControllerDelegate: AnyObject, Sendable {
+ func rootContainerViewControllerShouldShowDebugView(
+ _ controller: RootContainerViewController,
+ animated: Bool
+ )
+
func rootContainerViewControllerShouldShowAccount(
_ controller: RootContainerViewController,
animated: Bool
@@ -293,6 +298,14 @@ class RootContainerViewController: UIViewController {
updateHeaderBarHiddenFromChildPreferences(animated: UIView.areAnimationsEnabled)
}
+ /// Request to display debug view
+ func showDebugView(animated: Bool) {
+ delegate?.rootContainerViewControllerShouldShowDebugView(
+ self,
+ animated: animated
+ )
+ }
+
/// Request to display settings controller
func showAccount(animated: Bool) {
delegate?.rootContainerViewControllerShouldShowAccount(
@@ -361,6 +374,15 @@ class RootContainerViewController: UIViewController {
// Prevent automatic layout margins adjustment as we manually control them.
headerBarView.insetsLayoutMarginsFromSafeArea = false
+ #if DEBUG
+ headerBarView.logoImageView.isUserInteractionEnabled = true
+ headerBarView.logoImageView.addGestureRecognizer(
+ UITapGestureRecognizer(
+ target: self,
+ action: #selector(handleLogoTap(_:)))
+ )
+ #endif
+
headerBarView.accountButton.addTarget(
self,
action: #selector(handleAccountButtonTap),
@@ -418,6 +440,12 @@ class RootContainerViewController: UIViewController {
return button
}
+ @objc private func handleLogoTap(_ gestureRecognizer: UIGestureRecognizer) {
+ if gestureRecognizer.state == .ended {
+ showDebugView(animated: true)
+ }
+ }
+
@objc private func handleAccountButtonTap() {
showAccount(animated: true)
}