diff --git a/Multisig.xcodeproj/project.pbxproj b/Multisig.xcodeproj/project.pbxproj index 05ab404b7..6a32b0410 100644 --- a/Multisig.xcodeproj/project.pbxproj +++ b/Multisig.xcodeproj/project.pbxproj @@ -81,6 +81,9 @@ 0463F5C326296924009C04FA /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 0463F5C226296924009C04FA /* FirebaseCrashlytics */; }; 0463F5C526296924009C04FA /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 0463F5C426296924009C04FA /* FirebaseMessaging */; }; 0466877628E6388F0004D488 /* UIViewController+Display.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0466877528E6388F0004D488 /* UIViewController+Display.swift */; }; + 0468C32B2A826398009872C2 /* KeySecurityOverviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468C3292A826398009872C2 /* KeySecurityOverviewViewController.swift */; }; + 0468C32F2A83D1DA009872C2 /* SecurityFactorTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468C32D2A83D1DA009872C2 /* SecurityFactorTableViewCell.swift */; }; + 0468C3302A83D1DA009872C2 /* SecurityFactorTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0468C32E2A83D1DA009872C2 /* SecurityFactorTableViewCell.xib */; }; 0468EE9D26148A3B008270BF /* PrivacyProtectionScreenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468EE9B26148A3B008270BF /* PrivacyProtectionScreenViewController.swift */; }; 0468EE9E26148A3B008270BF /* PrivacyProtectionScreenViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0468EE9C26148A3B008270BF /* PrivacyProtectionScreenViewController.xib */; }; 0468FB45259106F400541536 /* StyledView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468FB44259106F400541536 /* StyledView.swift */; }; @@ -1127,6 +1130,9 @@ 04626EB4265E6BBC00CC7FC8 /* OwnerKeyDetailsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OwnerKeyDetailsViewController.swift; sourceTree = ""; }; 0463F5AB2628B60C009C04FA /* FirebaseRemoteConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseRemoteConfig.swift; sourceTree = ""; }; 0466877528E6388F0004D488 /* UIViewController+Display.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Display.swift"; sourceTree = ""; }; + 0468C3292A826398009872C2 /* KeySecurityOverviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeySecurityOverviewViewController.swift; sourceTree = ""; }; + 0468C32D2A83D1DA009872C2 /* SecurityFactorTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityFactorTableViewCell.swift; sourceTree = ""; }; + 0468C32E2A83D1DA009872C2 /* SecurityFactorTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SecurityFactorTableViewCell.xib; sourceTree = ""; }; 0468EE9B26148A3B008270BF /* PrivacyProtectionScreenViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyProtectionScreenViewController.swift; sourceTree = ""; }; 0468EE9C26148A3B008270BF /* PrivacyProtectionScreenViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PrivacyProtectionScreenViewController.xib; sourceTree = ""; }; 0468FB44259106F400541536 /* StyledView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StyledView.swift; sourceTree = ""; }; @@ -2274,6 +2280,16 @@ path = OwnerKeyDetailsViewController; sourceTree = ""; }; + 0468C3282A826199009872C2 /* MFA */ = { + isa = PBXGroup; + children = ( + 0468C3292A826398009872C2 /* KeySecurityOverviewViewController.swift */, + 0468C32D2A83D1DA009872C2 /* SecurityFactorTableViewCell.swift */, + 0468C32E2A83D1DA009872C2 /* SecurityFactorTableViewCell.xib */, + ); + path = MFA; + sourceTree = ""; + }; 0468FB8D25912E8300541536 /* Cells */ = { isa = PBXGroup; children = ( @@ -2986,6 +3002,7 @@ 0A6886A52588FB0F0045CAB5 /* Settings */ = { isa = PBXGroup; children = ( + 0468C3282A826199009872C2 /* MFA */, 0455A42C2720413B008B772D /* AddressBook */, 558835DE255A90420014E8C7 /* AppSettingsViewController */, 550FB1C626691E4A00C13D54 /* Experimental */, @@ -4991,6 +5008,7 @@ 0ADD0FB427C148880099DF7D /* DatePickerViewController.xib in Resources */, 0AD0273A25A34FF600886671 /* MultiSendRowTableViewCell.xib in Resources */, 04D1323625E43C560032FA03 /* DetailRejectionInfoCell.xib in Resources */, + 0468C3302A83D1DA009872C2 /* SecurityFactorTableViewCell.xib in Resources */, 0472B2AA2857B44F0049BA17 /* ShareTextView.xib in Resources */, 6A1CFA4B2807F24800B2C340 /* NoScreenshotViewController.xib in Resources */, 0A6630F128C10DC300F0FFAE /* AllocationTotalCell.xib in Resources */, @@ -5331,6 +5349,7 @@ D88FA81E2770869E0023B77F /* TokenAmountField.swift in Sources */, 93788EDC29C356F100503C1A /* NullCryptoProvider.swift in Sources */, 047588182774D6D2001DD992 /* ReviewSendFundsTransactionViewController.swift in Sources */, + 0468C32F2A83D1DA009872C2 /* SecurityFactorTableViewCell.swift in Sources */, 0A8AEB1025A4712B002A3FE1 /* ActionDetailTextCell.swift in Sources */, 0A7AEAF82463190100014184 /* LoadableENSNameText.swift in Sources */, 0A8CDD5327A85C0D0020066C /* TransactionExecutionLookup.swift in Sources */, @@ -5567,6 +5586,7 @@ 0ADF9DD028B4E02700D4FBA2 /* Guardian.swift in Sources */, 6AD4772F28932160004C736D /* GuardianCountTableViewCell.swift in Sources */, 5532D4BD2449A17D0067505A /* LogFormatter.swift in Sources */, + 0468C32B2A826398009872C2 /* KeySecurityOverviewViewController.swift in Sources */, 0AC0948527948BD900FA1B83 /* TransactionDataTransformer.swift in Sources */, 0A451C0C252DDBE5001DB7D2 /* CollectibleListSection.swift in Sources */, 55BCFC2A2551C9C200020CE7 /* UITableView+Reusable.swift in Sources */, diff --git a/Multisig/Assets.xcassets/ico-check.imageset/Check Filled.pdf b/Multisig/Assets.xcassets/ico-check.imageset/Check Filled.pdf new file mode 100644 index 000000000..5ef0e0bde Binary files /dev/null and b/Multisig/Assets.xcassets/ico-check.imageset/Check Filled.pdf differ diff --git a/Multisig/Assets.xcassets/ico-relayer-clock.imageset/Contents.json b/Multisig/Assets.xcassets/ico-check.imageset/Contents.json similarity index 73% rename from Multisig/Assets.xcassets/ico-relayer-clock.imageset/Contents.json rename to Multisig/Assets.xcassets/ico-check.imageset/Contents.json index 9980ca5f7..e3e5c72d2 100644 --- a/Multisig/Assets.xcassets/ico-relayer-clock.imageset/Contents.json +++ b/Multisig/Assets.xcassets/ico-check.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "ico-relayer-clock.pdf", + "filename" : "Check Filled.pdf", "idiom" : "universal" } ], diff --git a/Multisig/Assets.xcassets/ico-clock.imageset/Contents.json b/Multisig/Assets.xcassets/ico-clock.imageset/Contents.json new file mode 100644 index 000000000..e9847be45 --- /dev/null +++ b/Multisig/Assets.xcassets/ico-clock.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ico-relayer-clock.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/Multisig/Assets.xcassets/ico-relayer-clock.imageset/ico-relayer-clock.pdf b/Multisig/Assets.xcassets/ico-clock.imageset/ico-relayer-clock.pdf similarity index 100% rename from Multisig/Assets.xcassets/ico-relayer-clock.imageset/ico-relayer-clock.pdf rename to Multisig/Assets.xcassets/ico-clock.imageset/ico-relayer-clock.pdf diff --git a/Multisig/Assets.xcassets/ico-mobile.imageset/Contents.json b/Multisig/Assets.xcassets/ico-mobile.imageset/Contents.json new file mode 100644 index 000000000..8ad389caa --- /dev/null +++ b/Multisig/Assets.xcassets/ico-mobile.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "Mobile.pdf", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "Mobile (1).pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Multisig/Assets.xcassets/ico-mobile.imageset/Mobile (1).pdf b/Multisig/Assets.xcassets/ico-mobile.imageset/Mobile (1).pdf new file mode 100644 index 000000000..44a7b84a5 Binary files /dev/null and b/Multisig/Assets.xcassets/ico-mobile.imageset/Mobile (1).pdf differ diff --git a/Multisig/Assets.xcassets/ico-mobile.imageset/Mobile.pdf b/Multisig/Assets.xcassets/ico-mobile.imageset/Mobile.pdf new file mode 100644 index 000000000..ce6d8fb9a Binary files /dev/null and b/Multisig/Assets.xcassets/ico-mobile.imageset/Mobile.pdf differ diff --git a/Multisig/Assets.xcassets/ico-password.imageset/Contents.json b/Multisig/Assets.xcassets/ico-password.imageset/Contents.json new file mode 100644 index 000000000..19306c36a --- /dev/null +++ b/Multisig/Assets.xcassets/ico-password.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "Lock (1).pdf", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "Lock.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Multisig/Assets.xcassets/ico-password.imageset/Lock (1).pdf b/Multisig/Assets.xcassets/ico-password.imageset/Lock (1).pdf new file mode 100644 index 000000000..9052e73ea Binary files /dev/null and b/Multisig/Assets.xcassets/ico-password.imageset/Lock (1).pdf differ diff --git a/Multisig/Assets.xcassets/ico-password.imageset/Lock.pdf b/Multisig/Assets.xcassets/ico-password.imageset/Lock.pdf new file mode 100644 index 000000000..cb103257b Binary files /dev/null and b/Multisig/Assets.xcassets/ico-password.imageset/Lock.pdf differ diff --git a/Multisig/UI/Safe Management/Create Safe/Setup Safe/SafeCellBuilder.swift b/Multisig/UI/Safe Management/Create Safe/Setup Safe/SafeCellBuilder.swift index 8cdaa5d97..af75675c5 100644 --- a/Multisig/UI/Safe Management/Create Safe/Setup Safe/SafeCellBuilder.swift +++ b/Multisig/UI/Safe Management/Create Safe/Setup Safe/SafeCellBuilder.swift @@ -64,9 +64,13 @@ class SafeCellBuilder { return view } - func warningCell(image: UIImage? = nil, title: String? = nil, description: String? = nil, for indexPath: IndexPath) -> WarningTableViewCell { + func warningCell(image: UIImage? = nil, + title: String? = nil, + description: String? = nil, + backgroundColor: UIColor = .warningBackground, + for indexPath: IndexPath) -> WarningTableViewCell { let cell = tableView.dequeueCell(WarningTableViewCell.self, for: indexPath) - cell.set(image: image, title: title, description: description) + cell.set(image: image, title: title, description: description, backgroundColor: backgroundColor) return cell } diff --git a/Multisig/UI/Settings/MFA/KeySecurityOverviewViewController.swift b/Multisig/UI/Settings/MFA/KeySecurityOverviewViewController.swift new file mode 100644 index 000000000..c0b887003 --- /dev/null +++ b/Multisig/UI/Settings/MFA/KeySecurityOverviewViewController.swift @@ -0,0 +1,161 @@ +// +// KeySecurityOverviewViewController.swift +// Multisig +// +// Created by Mouaz on 8/8/23. +// Copyright © 2023 Gnosis Ltd. All rights reserved. +// + +import UIKit + +fileprivate protocol SectionItem {} + +class KeySecurityOverviewViewController: LoadableViewController, UITableViewDelegate, UITableViewDataSource { + @IBOutlet private var infoButton: UIBarButtonItem! + + private typealias SectionItems = (section: Section, items: [SectionItem]) + private var sections = [SectionItems]() + + enum Section { + case enabledFactors(String) + case otherFactors(String) + case info + + enum Factor: SectionItem { + case factor(String, String?, String, Bool, Bool) + } + + enum Info: SectionItem { + case info(String, String) + } + } + + convenience init() { + self.init(namedClass: Self.superclass()) + } + + override func viewDidLoad() { + super.viewDidLoad() + + tableView.registerCell(SecurityFactorTableViewCell.self) + tableView.registerCell(WarningTableViewCell.self) + tableView.registerHeaderFooterView(BasicHeaderView.self) + + tableView.rowHeight = UITableView.automaticDimension + tableView.estimatedRowHeight = 60 + + tableView.delegate = self + tableView.dataSource = self + tableView.tableFooterView = UIView() + title = "Recovery Kit" + + if #available(iOS 15.0, *) { + tableView.sectionHeaderTopPadding = 0 + } + + infoButton = UIBarButtonItem(image: UIImage(named: "ico-info-24"), + style: UIBarButtonItem.Style.plain, + target: self, + action: #selector(showHelpScreen)) + navigationItem.rightBarButtonItem = infoButton + } + + @objc func showHelpScreen() { + + } + + override func reloadData() { + buildSections() + tableView.reloadData() + } + + private func buildSections() { + sections = [] + + // TODO: Build sections properly + sections.append(SectionItems(section: .enabledFactors("ENABLED FACTORS"), items: [ + Section.Factor.factor("Email address", "ann.fischer@gmail", "ico-eMail", true, true)])) + sections.append(SectionItems(section: .otherFactors("OTHER FACTORS"), + items: [ + Section.Factor.factor("Security password", nil, "ico-password", false, false), + Section.Factor.factor("Trusted device", nil, "ico-mobile", false, false)])) + sections.append(SectionItems(section: .info, + items: [Section.Info.info("More factors are coming soon!", "ico-clock")])) + + let header = TableHeaderView(frame: CGRect(x: 0, y: 0, width: 0, height: 120)) + header.set("Protect your owner from unauthorised access and ensure easy recovery. We recommend to enable at least 2 recovery factors.", centered: true, linesCount: 3, backgroundColor: .backgroundPrimary) + + tableView.tableHeaderView = header + } + + func numberOfSections(in tableView: UITableView) -> Int { + sections.count + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + sections[section].items.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let factor = sections[indexPath.section].items[indexPath.row] + switch sections[indexPath.section].section { + case .enabledFactors(_), .otherFactors(_): + if case let Section.Factor.factor(name, value, image, isDefault, selected) = factor { + let cell = tableView.dequeueCell(SecurityFactorTableViewCell.self, for: indexPath) + cell.selectionStyle = .none + cell.set(name: name, + icon: UIImage(named: image)!, + value: value, + tag: isDefault ? "(Default)" : nil, + selected: selected) + + return cell + } + case .info: + if case let Section.Info.info(text, image) = factor { + let cell = tableView.dequeueCell(WarningTableViewCell.self, for: indexPath) + cell.selectionStyle = .none + cell.set(image: UIImage(named: image)?.withTintColor(.info, renderingMode: .alwaysOriginal), + description: text, + backgroundColor: .infoBackground) + cell.backgroundColor = .clear + + return cell + } + } + + return UITableViewCell() + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + + } + + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + var view: UIView? + + var title: String + switch sections[section].section { + case .enabledFactors(let name): + title = name + case .otherFactors(let name): + title = name + case .info: + title = "" + } + + view = tableView.dequeueHeaderFooterView(BasicHeaderView.self) + (view as! BasicHeaderView).setName(title, backgroundColor: .clear, style: .caption2Secondary) + + return view + } + + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + switch sections[section].section { + case .info: + return 0 + default: + return BasicHeaderView.headerHeight + } + } +} diff --git a/Multisig/UI/Settings/MFA/SecurityFactorTableViewCell.swift b/Multisig/UI/Settings/MFA/SecurityFactorTableViewCell.swift new file mode 100644 index 000000000..d83b9078b --- /dev/null +++ b/Multisig/UI/Settings/MFA/SecurityFactorTableViewCell.swift @@ -0,0 +1,37 @@ +// +// SecurityFactorTableViewCell.swift +// Multisig +// +// Created by Mouaz on 8/9/23. +// Copyright © 2023 Gnosis Ltd. All rights reserved. +// + +import UIKit + +class SecurityFactorTableViewCell: UITableViewCell { + + @IBOutlet private weak var selectedImageView: UIImageView! + @IBOutlet private weak var iconImageView: UIImageView! + @IBOutlet private weak var tagLabel: UILabel! + @IBOutlet private weak var valueLabel: UILabel! + @IBOutlet private weak var nameLabel: UILabel! + + override func awakeFromNib() { + super.awakeFromNib() + + nameLabel.setStyle(.headline) + tagLabel.setStyle(.subheadlineSecondary) + valueLabel.setStyle(.callout) + } + + func set(name: String, icon: UIImage, value: String? = nil, tag: String? = nil, selected: Bool = false) { + nameLabel.text = name + valueLabel.text = value + valueLabel.isHidden = value == nil + tagLabel.text = tag + tagLabel.isHidden = tag == nil + selectedImageView.isHidden = !selected + iconImageView.image = icon + layoutIfNeeded() + } +} diff --git a/Multisig/UI/Settings/MFA/SecurityFactorTableViewCell.xib b/Multisig/UI/Settings/MFA/SecurityFactorTableViewCell.xib new file mode 100644 index 000000000..b8929dc3a --- /dev/null +++ b/Multisig/UI/Settings/MFA/SecurityFactorTableViewCell.xib @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Multisig/UI/Settings/SafeSettingsViewController/SafeSettingsViewController.swift b/Multisig/UI/Settings/SafeSettingsViewController/SafeSettingsViewController.swift index ce2a0e5e1..06484476d 100644 --- a/Multisig/UI/Settings/SafeSettingsViewController/SafeSettingsViewController.swift +++ b/Multisig/UI/Settings/SafeSettingsViewController/SafeSettingsViewController.swift @@ -46,6 +46,10 @@ class SafeSettingsViewController: LoadableViewController, UITableViewDelegate, U case name(String) } + enum Security: SectionItem { + case security(String, Bool) + } + enum RequiredConfirmations: SectionItem { case confirmations(String) } @@ -226,6 +230,8 @@ class SafeSettingsViewController: LoadableViewController, UITableViewDelegate, U sections += [ (section: .name("Safe Account Name"), items: [Section.Name.name(safe.name ?? "Safe \(safe.addressValue.ellipsized())")]), + // TODO: Handle when exactly to show the security row + (section: .name("SECURITY"), items: [Section.Security.security("Account security", true)]), (section: .requiredConfirmations("Required confirmations"), items: [Section.RequiredConfirmations.confirmations("\(threshold) out of \(ownersInfo.count)")]), @@ -273,7 +279,11 @@ class SafeSettingsViewController: LoadableViewController, UITableViewDelegate, U switch item { case Section.Name.name(let name): return tableView.basicCell(name: name, indexPath: indexPath) - + case Section.Security.security(let name, let showWarning): + return tableView.basicCell(name: name, + icon: "ico-shield-infobox", + indexPath: indexPath, + supplementaryImage: showWarning ? UIImage(named:"ico-info-24")?.withTintColor(.warning) : nil) case Section.RequiredConfirmations.confirmations(let name): let canChangeConfirmations = ChangeConfirmationsFlow.canChangeConfirmations(safe: safe) return tableView.basicCell(name: name, @@ -495,7 +505,9 @@ class SafeSettingsViewController: LoadableViewController, UITableViewDelegate, U } } show(editSafeNameViewController, sender: self) - + case Section.Security.security(_, _): + let vc = KeySecurityOverviewViewController() + show(vc, sender: self) case Section.RequiredConfirmations.confirmations(_): changeConfirmationsFlow = ChangeConfirmationsFlow(safe: safe) { [unowned self] _ in changeConfirmationsFlow = nil diff --git a/Multisig/UI/Transaction/TransactionListViewController/Cells/TransactionListTableViewCell.xib b/Multisig/UI/Transaction/TransactionListViewController/Cells/TransactionListTableViewCell.xib index 9c160e002..3204e60f4 100644 --- a/Multisig/UI/Transaction/TransactionListViewController/Cells/TransactionListTableViewCell.xib +++ b/Multisig/UI/Transaction/TransactionListViewController/Cells/TransactionListTableViewCell.xib @@ -1,9 +1,9 @@ - + - + diff --git a/Multisig/UI/UI Library/Views/BasicCell.xib b/Multisig/UI/UI Library/Views/BasicCell.xib index f291327d5..cddc2122b 100644 --- a/Multisig/UI/UI Library/Views/BasicCell.xib +++ b/Multisig/UI/UI Library/Views/BasicCell.xib @@ -1,9 +1,9 @@ - + - + diff --git a/Multisig/UI/UI Library/Views/TableViewCell/TableHeaderView/TableHeaderView.swift b/Multisig/UI/UI Library/Views/TableViewCell/TableHeaderView/TableHeaderView.swift index ee656f489..fa6df877c 100644 --- a/Multisig/UI/UI Library/Views/TableViewCell/TableHeaderView/TableHeaderView.swift +++ b/Multisig/UI/UI Library/Views/TableViewCell/TableHeaderView/TableHeaderView.swift @@ -11,11 +11,14 @@ import UIKit class TableHeaderView: UINibView { @IBOutlet private weak var titleLabel: UILabel! - func set(_ title: String, style: GNOTextStyle = .body, centered: Bool = false) { + func set(_ title: String, style: GNOTextStyle = .body, centered: Bool = false, linesCount: Int = 2, backgroundColor: UIColor = .systemBackground) { titleLabel.text = title + titleLabel.numberOfLines = linesCount titleLabel.setStyle(style) if centered { titleLabel.textAlignment = .center } + + self.backgroundColor = backgroundColor } } diff --git a/Multisig/UI/UI Library/Views/TableViewCell/TableHeaderView/TableHeaderView.xib b/Multisig/UI/UI Library/Views/TableViewCell/TableHeaderView/TableHeaderView.xib index ad163750a..0de782881 100644 --- a/Multisig/UI/UI Library/Views/TableViewCell/TableHeaderView/TableHeaderView.xib +++ b/Multisig/UI/UI Library/Views/TableViewCell/TableHeaderView/TableHeaderView.xib @@ -5,7 +5,6 @@ - @@ -20,7 +19,7 @@ - @@ -43,9 +41,4 @@ - - - - - diff --git a/Multisig/UI/UI Library/Views/TableViewCell/WarningTableViewCell/WarningTableViewCell.swift b/Multisig/UI/UI Library/Views/TableViewCell/WarningTableViewCell/WarningTableViewCell.swift index 9c6a6fc6b..056e34cc0 100644 --- a/Multisig/UI/UI Library/Views/TableViewCell/WarningTableViewCell/WarningTableViewCell.swift +++ b/Multisig/UI/UI Library/Views/TableViewCell/WarningTableViewCell/WarningTableViewCell.swift @@ -11,8 +11,10 @@ import UIKit class WarningTableViewCell: UITableViewCell { @IBOutlet private weak var warningView: WarningView! - func set(image: UIImage? = nil, title: String? = nil, description: String? = nil) { - warningView.set(image: image, title: title, description: description) - layoutIfNeeded() + func set(image: UIImage? = nil, + title: String? = nil, + description: String? = nil, + backgroundColor: UIColor = .warningBackground) { + warningView.set(image: image, title: title, description: description, backgroundColor: backgroundColor) } } diff --git a/Multisig/UI/UI Library/Views/WarningView.swift b/Multisig/UI/UI Library/Views/WarningView.swift index 89a99848f..f66ecb5f6 100644 --- a/Multisig/UI/UI Library/Views/WarningView.swift +++ b/Multisig/UI/UI Library/Views/WarningView.swift @@ -33,7 +33,10 @@ class WarningView: UINibView { contentStackView.spacing = 16 } - func set(image: UIImage? = nil, title: String? = nil, description: String? = nil) { + func set(image: UIImage? = nil, + title: String? = nil, + description: String? = nil, + backgroundColor: UIColor = .warningBackground) { assert(title != nil || description != nil) if let image = image { @@ -45,6 +48,7 @@ class WarningView: UINibView { descriptionLabel.text = description descriptionLabel.isHidden = description == nil + self.backgroundColor = backgroundColor } // Do everything required for delegate warning if true diff --git a/Multisig/UI/UI Library/Views/WarningView.xib b/Multisig/UI/UI Library/Views/WarningView.xib index 76317f274..9d5a321e0 100644 --- a/Multisig/UI/UI Library/Views/WarningView.xib +++ b/Multisig/UI/UI Library/Views/WarningView.xib @@ -1,9 +1,9 @@ - + - + @@ -38,7 +38,6 @@ - @@ -73,7 +72,6 @@ - @@ -95,8 +93,5 @@ - - -