diff --git a/Kukai Mobile.xcodeproj/project.pbxproj b/Kukai Mobile.xcodeproj/project.pbxproj index e66cf66d..e0735b3e 100644 --- a/Kukai Mobile.xcodeproj/project.pbxproj +++ b/Kukai Mobile.xcodeproj/project.pbxproj @@ -163,6 +163,7 @@ C055EF1E2A2F95310031CB5F /* ShowQRViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C055EF1D2A2F95310031CB5F /* ShowQRViewController.swift */; }; C055EF212A2F95ED0031CB5F /* QRCode in Frameworks */ = {isa = PBXBuildFile; productRef = C055EF202A2F95ED0031CB5F /* QRCode */; }; C057CF622AB0BC0900E82D41 /* UIDevice+extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C057CF612AB0BC0900E82D41 /* UIDevice+extensions.swift */; }; + C057E3882BE2D03700189234 /* CustomNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C057E3872BE2D03700189234 /* CustomNavigationController.swift */; }; C05848A8280EF5CC007933CA /* ThemePickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C05848A7280EF5CC007933CA /* ThemePickerViewController.swift */; }; C05B0A2F2A03F9E3005AA803 /* CollectiblesCollectionHeaderSmallCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C05B0A2D2A03F9E3005AA803 /* CollectiblesCollectionHeaderSmallCell.swift */; }; C05B0A302A03F9E3005AA803 /* CollectiblesCollectionHeaderSmallCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C05B0A2E2A03F9E3005AA803 /* CollectiblesCollectionHeaderSmallCell.xib */; }; @@ -571,6 +572,7 @@ C055EF1B2A2F85B60031CB5F /* CurrencyChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrencyChoiceCell.swift; sourceTree = ""; }; C055EF1D2A2F95310031CB5F /* ShowQRViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowQRViewController.swift; sourceTree = ""; }; C057CF612AB0BC0900E82D41 /* UIDevice+extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIDevice+extensions.swift"; sourceTree = ""; }; + C057E3872BE2D03700189234 /* CustomNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomNavigationController.swift; sourceTree = ""; }; C05848A7280EF5CC007933CA /* ThemePickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemePickerViewController.swift; sourceTree = ""; }; C05B0A2D2A03F9E3005AA803 /* CollectiblesCollectionHeaderSmallCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectiblesCollectionHeaderSmallCell.swift; sourceTree = ""; }; C05B0A2E2A03F9E3005AA803 /* CollectiblesCollectionHeaderSmallCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CollectiblesCollectionHeaderSmallCell.xib; sourceTree = ""; }; @@ -1156,6 +1158,7 @@ C0C8CF7A2A793F0700AED75B /* InfoBottomSheetViewController.swift */, C0FE432B2AD6A00500312940 /* PassthroughTapGestureRecognizer.swift */, C0FE432D2AD6D44400312940 /* CustomAVPlayerViewController.swift */, + C057E3872BE2D03700189234 /* CustomNavigationController.swift */, ); path = Controls; sourceTree = ""; @@ -2036,6 +2039,7 @@ C0FBC893292C162000B29921 /* HiddenBalancesViewModel.swift in Sources */, C04E286A293F950900DC4171 /* TokenDetailsActivityHeaderCell.swift in Sources */, C06E0D61287C3E28007A580B /* WalletConnectViewModel.swift in Sources */, + C057E3882BE2D03700189234 /* CustomNavigationController.swift in Sources */, C0F7113529DCBA0D00FA59E0 /* RecoveryPhraseInfoViewController.swift in Sources */, C0082C0826A7278000DB160B /* HomeTabBarController.swift in Sources */, C07E283A29E84C0E00E8529A /* AccountItemCell.swift in Sources */, diff --git a/Kukai Mobile/Controls/CustomNavigationController.swift b/Kukai Mobile/Controls/CustomNavigationController.swift new file mode 100644 index 00000000..d4ecd4eb --- /dev/null +++ b/Kukai Mobile/Controls/CustomNavigationController.swift @@ -0,0 +1,54 @@ +// +// CustomNavigationController.swift +// Kukai Mobile +// +// Created by Simon Mcloughlin on 01/05/2024. +// + +import UIKit + +class CustomNavigationController: UINavigationController { + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + updateNavBar() + } + + func updateNavBar() { + for view in self.navigationBar.subviews { + + let string = "\(view.classForCoder)" + if string.contains("ContentView") { + + // Adjust left and right constraints of the content view + for constraint in view.constraints { + if constraint.firstAttribute == .leading || constraint.secondAttribute == .leading { + + if constraint.constant > 12 { + constraint.constant = 16 + } + + } else if constraint.firstAttribute == .trailing || constraint.secondAttribute == .trailing { + + if constraint.constant < -12 { + constraint.constant = -16 + } + } + } + + // Adjust constraints between items in stack view + for subview in view.subviews { + + if subview is UIStackView { + for constraint in subview.constraints { + if constraint.firstAttribute == .width || constraint.secondAttribute == .width { + constraint.constant = 0 + } + } + } + } + } + } + } +} diff --git a/Kukai Mobile/Modules/Home/Base.lproj/Home.storyboard b/Kukai Mobile/Modules/Home/Base.lproj/Home.storyboard index 4769ccd3..eafdb4e7 100644 --- a/Kukai Mobile/Modules/Home/Base.lproj/Home.storyboard +++ b/Kukai Mobile/Modules/Home/Base.lproj/Home.storyboard @@ -30,8 +30,20 @@ + + + + + + @@ -71,6 +95,10 @@ + + + + @@ -657,13 +685,13 @@ - + @@ -679,7 +707,7 @@ - + @@ -692,7 +720,7 @@ - + - + @@ -803,7 +831,7 @@ - + @@ -823,13 +851,13 @@ - + @@ -847,14 +875,14 @@ - + - +