Skip to content

Commit

Permalink
Merge branch 'feature/pre_beta' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed May 1, 2024
2 parents 0deb628 + a7c9e3b commit 415a614
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 81 deletions.
4 changes: 4 additions & 0 deletions Kukai Mobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -571,6 +572,7 @@
C055EF1B2A2F85B60031CB5F /* CurrencyChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrencyChoiceCell.swift; sourceTree = "<group>"; };
C055EF1D2A2F95310031CB5F /* ShowQRViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowQRViewController.swift; sourceTree = "<group>"; };
C057CF612AB0BC0900E82D41 /* UIDevice+extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIDevice+extensions.swift"; sourceTree = "<group>"; };
C057E3872BE2D03700189234 /* CustomNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomNavigationController.swift; sourceTree = "<group>"; };
C05848A7280EF5CC007933CA /* ThemePickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemePickerViewController.swift; sourceTree = "<group>"; };
C05B0A2D2A03F9E3005AA803 /* CollectiblesCollectionHeaderSmallCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectiblesCollectionHeaderSmallCell.swift; sourceTree = "<group>"; };
C05B0A2E2A03F9E3005AA803 /* CollectiblesCollectionHeaderSmallCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CollectiblesCollectionHeaderSmallCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1156,6 +1158,7 @@
C0C8CF7A2A793F0700AED75B /* InfoBottomSheetViewController.swift */,
C0FE432B2AD6A00500312940 /* PassthroughTapGestureRecognizer.swift */,
C0FE432D2AD6D44400312940 /* CustomAVPlayerViewController.swift */,
C057E3872BE2D03700189234 /* CustomNavigationController.swift */,
);
path = Controls;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down
54 changes: 54 additions & 0 deletions Kukai Mobile/Controls/CustomNavigationController.swift
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
}
}
}
}
Loading

0 comments on commit 415a614

Please sign in to comment.