Skip to content

Commit

Permalink
feat(ios): Style background and title
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarth committed Nov 11, 2023
1 parent 48adce0 commit 05be512
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ class KeccakSetupViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white

// Set title
let title = UILabel()
title.text = "Keccak256 (setup)"
title.textColor = .white
title.textAlignment = .center
navigationItem.titleView = title
navigationController?.navigationBar.isHidden = false
navigationController?.navigationBar.prefersLargeTitles = true
navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black]
navigationController?.navigationBar.barTintColor = UIColor.white // or any other contrasting color
self.title = "Keccak256 (setup)"

// view.backgroundColor = .white
// navigationController?.navigationBar.prefersLargeTitles = true
// navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black]
// navigationController?.navigationBar.barTintColor = UIColor.white // or any other contrasting color
// self.title = "Keccak256 (setup)"

setupUI()
}

Expand All @@ -38,7 +49,7 @@ class KeccakSetupViewController: UIViewController {

textView.isEditable = false

self.title = "Keccak256 (setup)"
//self.title = "Keccak256 (setup)"
//view.backgroundColor = .black

// Setup actions for buttons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ class KeccakZkeyViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white

// Set title
let title = UILabel()
title.text = "Keccak256 (Zkey)"
title.textColor = .white
title.textAlignment = .center
navigationItem.titleView = title
navigationController?.navigationBar.isHidden = false
navigationController?.navigationBar.prefersLargeTitles = true
self.title = "Keccak256 (zkey)"

setupUI()
}

Expand All @@ -41,8 +47,6 @@ class KeccakZkeyViewController: UIViewController {
verifyButton.isEnabled = false
textView.isEditable = false

self.title = "Keccak256 (zkey)"

// Setup actions for buttons
initButton.addTarget(self, action: #selector(runInitAction), for: .touchUpInside)
proveButton.addTarget(self, action: #selector(runProveAction), for: .touchUpInside)
Expand Down
11 changes: 8 additions & 3 deletions mopro-ios/MoproKit/Example/MoproKit/RSAViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ class RSAViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white

// Set title
let title = UILabel()
title.text = "RSA (Zkey)"
title.textColor = .white
title.textAlignment = .center
navigationItem.titleView = title
navigationController?.navigationBar.isHidden = false
navigationController?.navigationBar.prefersLargeTitles = true

setupUI()
}

Expand All @@ -40,8 +47,6 @@ class RSAViewController: UIViewController {
verifyButton.isEnabled = false
textView.isEditable = false

self.title = "RSA (zkey)"

// Setup actions for buttons
initButton.addTarget(self, action: #selector(runInitAction), for: .touchUpInside)
proveButton.addTarget(self, action: #selector(runProveAction), for: .touchUpInside)
Expand Down
19 changes: 14 additions & 5 deletions mopro-ios/MoproKit/Example/MoproKit/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Maybe black nice, need more style tweaks though
view.backgroundColor = .white

// TODO: Not showing up for some reason
// TODO: Improve style

// Set title
let title = UILabel()
title.text = "Mopro Examples"
title.textColor = .white
title.textAlignment = .center
navigationItem.titleView = title
navigationController?.navigationBar.isHidden = false
navigationController?.navigationBar.prefersLargeTitles = true
self.title = "Mopro Examples"

setupMainUI()
}

Expand All @@ -38,6 +43,10 @@ class ViewController: UIViewController {
rsaButton.setTitle("RSA", for: .normal)
rsaButton.addTarget(self, action: #selector(openRSA), for: .touchUpInside)

// self.title = "Mopro Examples"
// navigationController?.navigationBar.prefersLargeTitles = true


let stackView = UIStackView(arrangedSubviews: [keccakSetupButton, keccakZkeyButton, rsaButton])
stackView.axis = .vertical
stackView.spacing = 20
Expand Down

0 comments on commit 05be512

Please sign in to comment.