Merge pull request #2329 from vladyslav-iosdev/#2322

Refactor: return non-optionals from Fonts.light(size:) and other font functions #2322
pull/2327/head
Hwee-Boon Yar 4 years ago committed by GitHub
commit 7a3f39b7fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      AlphaWallet/Accounts/ViewModels/AccountViewModel.swift
  2. 26
      AlphaWallet/Activities/ViewModels/DefaultActivityCellViewModel.swift
  3. 6
      AlphaWallet/Activities/ViewModels/DefaultActivityViewModel.swift
  4. 2
      AlphaWallet/AlphaWalletHelp/Views/HelpViewCell.swift
  5. 4
      AlphaWallet/Browser/ViewModel/BrowserHistoryCellViewModel.swift
  6. 4
      AlphaWallet/Browser/ViewModel/DappViewCellViewModel.swift
  7. 4
      AlphaWallet/Browser/ViewModel/DappsAutoCompletionCellViewModel.swift
  8. 6
      AlphaWallet/Browser/ViewModel/DiscoverDappCellViewModel.swift
  9. 12
      AlphaWallet/Browser/ViewModel/EditMyDappViewControllerViewModel.swift
  10. 6
      AlphaWallet/Browser/ViewModel/MyDappCellViewModel.swift
  11. 6
      AlphaWallet/Export/ViewModels/PromptBackupWalletViewViewModel.swift
  12. 10
      AlphaWallet/Market/ViewModels/ImportMagicTokenViewControllerViewModel.swift
  13. 4
      AlphaWallet/Market/ViewModels/StatusViewControllerViewModel.swift
  14. 2
      AlphaWallet/Redeem/ViewModels/RedeemTokenCardQuantitySelectionViewModel.swift
  15. 2
      AlphaWallet/Redeem/ViewModels/TokenCardRedemptionViewModel.swift
  16. 10
      AlphaWallet/Sell/ViewModels/EnterSellTokensCardPriceQuantityViewControllerViewModel.swift
  17. 8
      AlphaWallet/Sell/ViewModels/GenerateSellMagicLinkViewControllerViewModel.swift
  18. 8
      AlphaWallet/Sell/ViewModels/GenerateTransferMagicLinkViewControllerViewModel.swift
  19. 10
      AlphaWallet/Sell/ViewModels/SetSellTokensCardExpiryDateViewControllerViewModel.swift
  20. 2
      AlphaWallet/Settings/ViewControllers/WellDoneViewController.swift
  21. 2
      AlphaWallet/Settings/ViewModels/LocaleViewModel.swift
  22. 2
      AlphaWallet/Settings/ViewModels/ServerViewModel.swift
  23. 4
      AlphaWallet/Settings/ViewModels/SettingTableViewCellViewModel.swift
  24. 6
      AlphaWallet/Settings/ViewModels/SettingViewHeaderViewModel.swift
  25. 2
      AlphaWallet/Settings/ViewModels/SwitchTableViewCellViewModel.swift
  26. 2
      AlphaWallet/Settings/Views/SettingsHeaderView.swift
  27. 46
      AlphaWallet/Style/AppStyle.swift
  28. 2
      AlphaWallet/TokenScriptClient/ViewModels/AssetDefinitionsOverridesViewCellViewModel.swift
  29. 2
      AlphaWallet/Tokens/ViewControllers/TokensViewController.swift
  30. 4
      AlphaWallet/Tokens/ViewModels/ImportWalletHelpBubbleViewViewModel.swift
  31. 2
      AlphaWallet/Tokens/ViewModels/NewTokenViewModel.swift
  32. 4
      AlphaWallet/Tokens/ViewModels/OpenSea/OpenSeaNonFungibleTokenAttributeCellViewModel.swift
  33. 2
      AlphaWallet/Tokens/ViewModels/OpenSea/OpenSeaNonFungibleTokenViewCellViewModel.swift
  34. 30
      AlphaWallet/Tokens/ViewModels/OpenSeaNonFungibleTokenCardRowViewModel.swift
  35. 4
      AlphaWallet/Tokens/ViewModels/SegmentedControlViewModel.swift
  36. 16
      AlphaWallet/Tokens/ViewModels/TokenListFormatRowViewModel.swift
  37. 2
      AlphaWallet/Tokens/ViewModels/TokenViewControllerTransactionCellViewModel.swift
  38. 2
      AlphaWallet/Tokens/Views/TokensCardViewControllerTitleHeader.swift
  39. 8
      AlphaWallet/Transactions/ViewModels/ActivityViewModel.swift
  40. 8
      AlphaWallet/Transactions/ViewModels/TransactionCellViewModel.swift
  41. 4
      AlphaWallet/Transfer/ViewModels/ChooseTokenCardTransferModeViewControllerViewModel.swift
  42. 10
      AlphaWallet/Transfer/ViewModels/ConfirmSignMessageViewControllerViewModel.swift
  43. 8
      AlphaWallet/Transfer/ViewModels/GasSpeedTableViewCellViewModel.swift
  44. 2
      AlphaWallet/Transfer/ViewModels/GasSpeedTableViewHeaderViewModel.swift
  45. 6
      AlphaWallet/Transfer/ViewModels/RequestViewModel.swift
  46. 4
      AlphaWallet/Transfer/ViewModels/SendHeaderViewViewModel.swift
  47. 4
      AlphaWallet/Transfer/ViewModels/SendViewModel.swift
  48. 2
      AlphaWallet/Transfer/ViewModels/SendViewSectionHeaderViewModel.swift
  49. 8
      AlphaWallet/Transfer/ViewModels/SetTransferTokensCardExpiryDateViewControllerViewModel.swift
  50. 2
      AlphaWallet/Transfer/ViewModels/TextFieldTableViewCellViewModel.swift
  51. 6
      AlphaWallet/Transfer/ViewModels/TransactionConfirmationTableHeaderViewModel.swift
  52. 4
      AlphaWallet/Transfer/ViewModels/TransactionInProgressViewModel.swift
  53. 2
      AlphaWallet/Transfer/ViewModels/TransferTokensCardQuantitySelectionViewModel.swift
  54. 2
      AlphaWallet/Transfer/ViewModels/TransferTokensCardViaWalletAddressViewControllerViewModel.swift
  55. 2
      AlphaWallet/UI/Button.swift
  56. 2
      AlphaWallet/UI/ButtonsBar.swift
  57. 2
      AlphaWallet/UI/NumberStepper.swift
  58. 4
      AlphaWallet/UI/StateViewModel.swift
  59. 16
      AlphaWallet/UI/ViewModels/TokenCardRowViewModelProtocol.swift
  60. 8
      AlphaWallet/UI/Views/AmountTextField.swift
  61. 6
      AlphaWallet/Wallet/ViewModels/CreateInitialWalletViewModel.swift
  62. 6
      AlphaWallet/Wallet/ViewModels/ElevateWalletSecurityViewModel.swift
  63. 4
      AlphaWallet/Wallet/ViewModels/ImportWalletViewModel.swift
  64. 2
      AlphaWallet/Wallet/ViewModels/PassphraseViewModel.swift
  65. 6
      AlphaWallet/Wallet/ViewModels/SeedPhraseCellViewModel.swift
  66. 2
      AlphaWallet/Wallet/ViewModels/ShowSeedPhraseViewModel.swift
  67. 6
      AlphaWallet/Wallet/ViewModels/VerifySeedPhraseViewModel.swift
  68. 2
      AlphaWallet/Welcome/ViewModels/OnboardingPageStyle.swift

@ -48,11 +48,11 @@ struct AccountViewModel {
}
var balanceFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var addressFont: UIFont {
return Fonts.regular(size: 12)!
return Fonts.regular(size: 12)
}
var addressTextColor: UIColor {

@ -39,13 +39,13 @@ struct DefaultActivityCellViewModel {
case .failed:
string = NSMutableAttributedString(string: "\(R.string.localizable.activitySendFailed(symbol))")
}
string.addAttribute(.font, value: Fonts.regular(size: 17)!, range: NSRange(location: 0, length: string.length))
string.addAttribute(.font, value: Fonts.semibold(size: 17)!, range: NSRange(location: string.length - symbol.count, length: symbol.count))
string.addAttribute(.font, value: Fonts.regular(size: 17), range: NSRange(location: 0, length: string.length))
string.addAttribute(.font, value: Fonts.semibold(size: 17), range: NSRange(location: string.length - symbol.count, length: symbol.count))
return string
case .erc20Received, .erc721Received, .nativeCryptoReceived:
let string = NSMutableAttributedString(string: "\(R.string.localizable.transactionCellReceivedTitle()) \(symbol)")
string.addAttribute(.font, value: Fonts.regular(size: 17)!, range: NSRange(location: 0, length: string.length))
string.addAttribute(.font, value: Fonts.semibold(size: 17)!, range: NSRange(location: string.length - symbol.count, length: symbol.count))
string.addAttribute(.font, value: Fonts.regular(size: 17), range: NSRange(location: 0, length: string.length))
string.addAttribute(.font, value: Fonts.semibold(size: 17), range: NSRange(location: string.length - symbol.count, length: symbol.count))
return string
case .erc20OwnerApproved, .erc721OwnerApproved:
let string: NSMutableAttributedString
@ -57,13 +57,13 @@ struct DefaultActivityCellViewModel {
case .failed:
string = NSMutableAttributedString(string: "\(R.string.localizable.activityOwnerApprovedFailed(symbol))")
}
string.addAttribute(.font, value: Fonts.regular(size: 17)!, range: NSRange(location: 0, length: string.length))
string.addAttribute(.font, value: Fonts.semibold(size: 17)!, range: NSRange(location: string.length - symbol.count, length: symbol.count))
string.addAttribute(.font, value: Fonts.regular(size: 17), range: NSRange(location: 0, length: string.length))
string.addAttribute(.font, value: Fonts.semibold(size: 17), range: NSRange(location: string.length - symbol.count, length: symbol.count))
return string
case .erc20ApprovalObtained, .erc721ApprovalObtained:
let string = NSMutableAttributedString(string: R.string.localizable.activityApprovalObtained(symbol))
string.addAttribute(.font, value: Fonts.regular(size: 17)!, range: NSRange(location: 0, length: string.length))
string.addAttribute(.font, value: Fonts.semibold(size: 17)!, range: NSRange(location: string.length - symbol.count, length: symbol.count))
string.addAttribute(.font, value: Fonts.regular(size: 17), range: NSRange(location: 0, length: string.length))
string.addAttribute(.font, value: Fonts.semibold(size: 17), range: NSRange(location: string.length - symbol.count, length: symbol.count))
return string
case .none:
return .init()
@ -106,7 +106,7 @@ struct DefaultActivityCellViewModel {
}
var subTitleFont: UIFont {
Fonts.regular(size: 12)!
Fonts.regular(size: 12)
}
var amount: NSAttributedString {
@ -154,16 +154,16 @@ struct DefaultActivityCellViewModel {
switch activity.state {
case .pending:
return NSAttributedString(string: string, attributes: [.font: Fonts.semibold(size: 17)!, .foregroundColor: R.color.black()!])
return NSAttributedString(string: string, attributes: [.font: Fonts.semibold(size: 17), .foregroundColor: R.color.black()!])
case .completed:
return NSAttributedString(string: string, attributes: [.font: Fonts.semibold(size: 17)!, .foregroundColor: R.color.black()!])
return NSAttributedString(string: string, attributes: [.font: Fonts.semibold(size: 17), .foregroundColor: R.color.black()!])
case .failed:
return NSAttributedString(string: string, attributes: [.font: Fonts.semibold(size: 17)!, .foregroundColor: R.color.silver()!, .strikethroughStyle: NSUnderlineStyle.single.rawValue])
return NSAttributedString(string: string, attributes: [.font: Fonts.semibold(size: 17), .foregroundColor: R.color.silver()!, .strikethroughStyle: NSUnderlineStyle.single.rawValue])
}
}
var timestampFont: UIFont {
Fonts.regular(size: 12)!
Fonts.regular(size: 12)
}
var timestampColor: UIColor {

@ -57,11 +57,11 @@ struct DefaultActivityViewModel {
switch activity.state {
case .pending:
return NSAttributedString(string: string, attributes: [.font: Fonts.regular(size: 28)!, .foregroundColor: R.color.black()!])
return NSAttributedString(string: string, attributes: [.font: Fonts.regular(size: 28), .foregroundColor: R.color.black()!])
case .completed:
return NSAttributedString(string: string, attributes: [.font: Fonts.regular(size: 28)!, .foregroundColor: R.color.black()!])
return NSAttributedString(string: string, attributes: [.font: Fonts.regular(size: 28), .foregroundColor: R.color.black()!])
case .failed:
return NSAttributedString(string: string, attributes: [.font: Fonts.regular(size: 28)!, .foregroundColor: R.color.silver()!, .strikethroughStyle: NSUnderlineStyle.single.rawValue])
return NSAttributedString(string: string, attributes: [.font: Fonts.regular(size: 28), .foregroundColor: R.color.silver()!, .strikethroughStyle: NSUnderlineStyle.single.rawValue])
}
}
}

@ -36,7 +36,7 @@ class HelpViewCell: UITableViewCell {
iconImageView.image = R.image.info_accessory()
textLabel?.textColor = Colors.appText
textLabel?.font = Fonts.light(size: 18)!
textLabel?.font = Fonts.light(size: 18)
textLabel?.text = text
}
}

@ -27,11 +27,11 @@ struct BrowserHistoryCellViewModel {
}
var nameFont: UIFont {
return Fonts.semibold(size: 12)!
return Fonts.semibold(size: 12)
}
var urlFont: UIFont {
return Fonts.semibold(size: 10)!
return Fonts.semibold(size: 10)
}
var nameColor: UIColor? {

@ -48,7 +48,7 @@ class DappViewCellViewModel {
}
var titleFont: UIFont {
return Fonts.regular(size: 12)!
return Fonts.regular(size: 12)
}
var domainNameColor: UIColor {
@ -56,6 +56,6 @@ class DappViewCellViewModel {
}
var domainNameFont: UIFont {
return Fonts.bold(size: 10)!
return Fonts.bold(size: 10)
}
}

@ -27,11 +27,11 @@ struct DappsAutoCompletionCellViewModel {
}
var nameFont: UIFont {
return Fonts.regular(size: 16)!
return Fonts.regular(size: 16)
}
var descriptionFont: UIFont {
return Fonts.light(size: 12)!
return Fonts.light(size: 12)
}
private var nameColor: UIColor? {

@ -44,11 +44,11 @@ struct DiscoverDappCellViewModel {
}
var nameFont: UIFont {
return Fonts.semibold(size: 12)!
return Fonts.semibold(size: 12)
}
var descriptionFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var nameColor: UIColor? {
@ -60,7 +60,7 @@ struct DiscoverDappCellViewModel {
}
var addRemoveButtonFont: UIFont {
return Fonts.semibold(size: 12)!
return Fonts.semibold(size: 12)
}
var addRemoveButtonContentEdgeInsets: UIEdgeInsets {

@ -43,7 +43,7 @@ struct EditMyDappViewControllerViewModel {
}
var screenFont: UIFont {
return Fonts.semibold(size: 20)!
return Fonts.semibold(size: 20)
}
var titleColor: UIColor {
@ -51,7 +51,7 @@ struct EditMyDappViewControllerViewModel {
}
var titleFont: UIFont {
return Fonts.semibold(size: 16)!
return Fonts.semibold(size: 16)
}
var titleText: String {
@ -63,7 +63,7 @@ struct EditMyDappViewControllerViewModel {
}
var urlFont: UIFont {
return Fonts.semibold(size: 16)!
return Fonts.semibold(size: 16)
}
var urlText: String {
@ -91,7 +91,7 @@ struct EditMyDappViewControllerViewModel {
}
var titleTextFieldFont: UIFont {
return Fonts.light(size: 16)!
return Fonts.light(size: 16)
}
var titleTextFieldText: String {
@ -115,7 +115,7 @@ struct EditMyDappViewControllerViewModel {
}
var urlTextFieldFont: UIFont {
return Fonts.light(size: 16)!
return Fonts.light(size: 16)
}
var urlTextFieldText: String {
@ -131,7 +131,7 @@ struct EditMyDappViewControllerViewModel {
}
var cancelButtonFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var cancelButtonTitle: String {

@ -27,11 +27,11 @@ struct MyDappCellViewModel {
}
var nameFont: UIFont {
return Fonts.semibold(size: 12)!
return Fonts.semibold(size: 12)
}
var domainNameFont: UIFont {
return Fonts.bold(size: 10)!
return Fonts.bold(size: 10)
}
var nameColor: UIColor? {
@ -43,7 +43,7 @@ struct MyDappCellViewModel {
}
var addRemoveButtonFont: UIFont {
return Fonts.semibold(size: 12)!
return Fonts.semibold(size: 12)
}
var addRemoveButtonContentEdgeInsets: UIEdgeInsets {

@ -29,7 +29,7 @@ extension PromptBackupWalletViewViewModel {
}
var titleFont: UIFont {
return Fonts.regular(size: 22)!
return Fonts.regular(size: 22)
}
var titleColor: UIColor {
@ -37,7 +37,7 @@ extension PromptBackupWalletViewViewModel {
}
var descriptionFont: UIFont {
return Fonts.regular(size: 13)!
return Fonts.regular(size: 13)
}
var descriptionColor: UIColor {
@ -49,7 +49,7 @@ extension PromptBackupWalletViewViewModel {
}
var backupButtonTitleFont: UIFont {
return Fonts.semibold(size: 16)!
return Fonts.semibold(size: 16)
}
var backupButtonImage: UIImage {

@ -206,7 +206,7 @@ struct ImportMagicTokenViewControllerViewModel {
}
var statusFont: UIFont {
return Fonts.regular(size: 25)!
return Fonts.regular(size: 25)
}
var showCost: Bool {
@ -222,7 +222,7 @@ struct ImportMagicTokenViewControllerViewModel {
}
var ethCostLabelLabelFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var ethCostLabelText: String {
@ -240,7 +240,7 @@ struct ImportMagicTokenViewControllerViewModel {
}
var ethCostLabelFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var dollarCostLabelLabelText: String {
@ -252,7 +252,7 @@ struct ImportMagicTokenViewControllerViewModel {
}
var dollarCostLabelLabelFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var dollarCostLabelText: String {
@ -276,7 +276,7 @@ struct ImportMagicTokenViewControllerViewModel {
}
var dollarCostLabelFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var showActionButton: Bool {

@ -31,7 +31,7 @@ struct StatusViewControllerViewModel {
return Colors.appText
}
var titleFont: UIFont {
return Fonts.light(size: 25)!
return Fonts.light(size: 25)
}
var activityIndicatorColor: UIColor {
return Colors.navigationTitleColor
@ -43,7 +43,7 @@ struct StatusViewControllerViewModel {
return Colors.appActionButtonGreen
}
var actionButtonTitleFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var titleLabelText: String {
switch state {

@ -32,7 +32,7 @@ struct RedeemTokenCardQuantitySelectionViewModel {
}
var subtitleFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var subtitleText: String {

@ -22,7 +22,7 @@ struct TokenCardRedemptionViewModel {
}
var headerFont: UIFont {
return Fonts.regular(size: 28)!
return Fonts.regular(size: 28)
}
var backgroundColor: UIColor {

@ -30,7 +30,7 @@ struct EnterSellTokensCardPriceQuantityViewControllerViewModel {
}
var choiceLabelFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var quantityLabelText: String {
@ -56,7 +56,7 @@ struct EnterSellTokensCardPriceQuantityViewControllerViewModel {
}
var ethCostLabelLabelFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var ethCostLabelLabelColor: UIColor {
@ -72,7 +72,7 @@ struct EnterSellTokensCardPriceQuantityViewControllerViewModel {
}
var ethCostLabelFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var dollarCostLabelLabelColor: UIColor {
@ -80,7 +80,7 @@ struct EnterSellTokensCardPriceQuantityViewControllerViewModel {
}
var dollarCostLabelLabelFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var dollarCostLabelText: String {
@ -92,7 +92,7 @@ struct EnterSellTokensCardPriceQuantityViewControllerViewModel {
}
var dollarCostLabelFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var dollarCostLabelBackgroundColor: UIColor {

@ -16,7 +16,7 @@ struct GenerateSellMagicLinkViewControllerViewModel {
return Colors.appText
}
var subtitleFont: UIFont {
return Fonts.light(size: 25)!
return Fonts.light(size: 25)
}
var subtitleLabelText: String {
return R.string.localizable.aWalletTokenSellConfirmSubtitle()
@ -33,7 +33,7 @@ struct GenerateSellMagicLinkViewControllerViewModel {
return Colors.appActionButtonGreen
}
var actionButtonTitleFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var cancelButtonTitleColor: UIColor {
return Colors.appRed
@ -42,7 +42,7 @@ struct GenerateSellMagicLinkViewControllerViewModel {
return .clear
}
var cancelButtonTitleFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var actionButtonTitle: String {
return R.string.localizable.aWalletTokenSellConfirmButtonTitle()
@ -52,7 +52,7 @@ struct GenerateSellMagicLinkViewControllerViewModel {
}
var tokenSaleDetailsLabelFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var tokenSaleDetailsLabelColor: UIColor {

@ -14,7 +14,7 @@ struct GenerateTransferMagicLinkViewControllerViewModel {
return Colors.appText
}
var subtitleFont: UIFont {
return Fonts.light(size: 25)!
return Fonts.light(size: 25)
}
var subtitleLabelText: String {
return R.string.localizable.aWalletTokenTransferConfirmSubtitle()
@ -31,7 +31,7 @@ struct GenerateTransferMagicLinkViewControllerViewModel {
return Colors.appActionButtonGreen
}
var actionButtonTitleFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var cancelButtonTitleColor: UIColor {
return Colors.appRed
@ -40,7 +40,7 @@ struct GenerateTransferMagicLinkViewControllerViewModel {
return .clear
}
var cancelButtonTitleFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var actionButtonTitle: String {
return R.string.localizable.aWalletTokenSellConfirmButtonTitle()
@ -50,7 +50,7 @@ struct GenerateTransferMagicLinkViewControllerViewModel {
}
var tokenSaleDetailsLabelFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var tokenSaleDetailsLabelColor: UIColor {

@ -24,7 +24,7 @@ struct SetSellTokensCardExpiryDateViewControllerViewModel {
}
var choiceLabelFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var linkExpiryDateLabelText: String {
@ -36,7 +36,7 @@ struct SetSellTokensCardExpiryDateViewControllerViewModel {
}
var tokenSaleDetailsLabelFont: UIFont {
return Fonts.regular(size: 21)!
return Fonts.regular(size: 21)
}
var tokenSaleDetailsLabelColor: UIColor {
@ -49,7 +49,7 @@ struct SetSellTokensCardExpiryDateViewControllerViewModel {
}
var descriptionLabelFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var descriptionLabelColor: UIColor {
@ -81,7 +81,7 @@ struct SetSellTokensCardExpiryDateViewControllerViewModel {
}
var noteTitleLabelFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var noteTitleLabelColor: UIColor {
@ -94,7 +94,7 @@ struct SetSellTokensCardExpiryDateViewControllerViewModel {
}
var noteLabelFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var noteLabelColor: UIColor {

@ -21,7 +21,7 @@ class WellDoneViewController: UIViewController {
let descriptionLabel = UILabel()
descriptionLabel.translatesAutoresizingMaskIntoConstraints = false
descriptionLabel.text = R.string.localizable.welldoneDescriptionLabelText()
descriptionLabel.font = Fonts.regular(size: Fonts.labelSize)
descriptionLabel.font = Label.Font.text
descriptionLabel.textColor = Colors.darkBlue
descriptionLabel.numberOfLines = 0
descriptionLabel.textAlignment = .center

@ -25,7 +25,7 @@ struct LocaleViewModel {
}
var localeFont: UIFont {
return Fonts.regular(size: 17)!
return Fonts.regular(size: 17)
}
var localeName: String {

@ -30,7 +30,7 @@ struct ServerViewModel {
}
var serverFont: UIFont {
return Fonts.regular(size: 17)!
return Fonts.regular(size: 17)
}
var serverName: String {

@ -17,7 +17,7 @@ struct SettingTableViewCellViewModel {
}
var titleFont: UIFont {
return Fonts.regular(size: 17)!
return Fonts.regular(size: 17)
}
var titleTextColor: UIColor {
@ -25,7 +25,7 @@ struct SettingTableViewCellViewModel {
}
var subTitleFont: UIFont {
return Fonts.regular(size: 12)!
return Fonts.regular(size: 12)
}
var subTitleTextColor: UIColor {

@ -21,7 +21,7 @@ struct SettingViewHeaderViewModel {
return R.color.dove()!
}
var detailsTextFont: UIFont {
return Fonts.regular(size: 13)!
return Fonts.regular(size: 13)
}
var backgroundColor: UIColor {
@ -39,12 +39,12 @@ extension SettingViewHeaderViewModel {
switch section {
case .tokenStandard(let value), .version(let value):
detailsText = value
titleTextFont = Fonts.regular(size: 15)!
titleTextFont = Fonts.regular(size: 15)
if case .tokenStandard = section {
showTopSeparator = false
}
case .wallet, .system, .help:
titleTextFont = Fonts.semibold(size: 15)!
titleTextFont = Fonts.semibold(size: 15)
}
}
}

@ -13,7 +13,7 @@ struct SwitchTableViewCellViewModel {
let value: Bool
var titleFont: UIFont {
return Fonts.regular(size: 17)!
return Fonts.regular(size: 17)
}
var titleTextColor: UIColor {

@ -23,7 +23,7 @@ class SettingsHeaderView: UIView {
backgroundColor = Colors.appBackground
titleLabel.textColor = Colors.appWhite
titleLabel.font = Fonts.regular(size: 16)!
titleLabel.font = Fonts.regular(size: 16)
titleLabel.translatesAutoresizingMaskIntoConstraints = false
addSubview(titleLabel)

@ -77,21 +77,19 @@ struct StyleLayout {
}
struct Fonts {
static let labelSize: CGFloat = 18
static func light(size: CGFloat) -> UIFont? {
return UIFont(resource: R.font.sourceSansProLight, size: size)
static func light(size: CGFloat) -> UIFont {
return UIFont(resource: R.font.sourceSansProLight, size: size)!
}
static func regular(size: CGFloat) -> UIFont? {
return UIFont(resource: R.font.sourceSansProRegular, size: size)
static func regular(size: CGFloat) -> UIFont {
return UIFont(resource: R.font.sourceSansProRegular, size: size)!
}
static func semibold(size: CGFloat) -> UIFont? {
return UIFont(resource: R.font.sourceSansProSemibold, size: size)
static func semibold(size: CGFloat) -> UIFont {
return UIFont(resource: R.font.sourceSansProSemibold, size: size)!
}
static func bold(size: CGFloat) -> UIFont? {
return UIFont(resource: R.font.sourceSansProBold, size: size)
static func bold(size: CGFloat) -> UIFont {
return UIFont(resource: R.font.sourceSansProBold, size: size)!
}
static let tableHeader = Fonts.semibold(size: 15)!
static let tableHeader = Fonts.semibold(size: 15)
}
extension UISegmentedControl {
@ -218,6 +216,12 @@ enum DataEntry {
}
}
enum Label {
enum Font {
static let text = Fonts.regular(size: 18)
}
}
enum Screen {
enum Tokens {
@ -225,16 +229,16 @@ enum Screen {
}
enum Backup {
static let subtitleFont = ScreenChecker().isNarrowScreen ? Fonts.regular(size: 22)! : Fonts.regular(size: 28)!
static let subtitleFont = ScreenChecker().isNarrowScreen ? Fonts.regular(size: 22) : Fonts.regular(size: 28)
static let subtitleColor = Colors.darkGray
static let descriptionFont = ScreenChecker().isNarrowScreen ? Fonts.regular(size: 16)! : Fonts.regular(size: 18)!
static let descriptionFont = ScreenChecker().isNarrowScreen ? Fonts.regular(size: 16) : Fonts.regular(size: 18)
static let descriptionColor = Colors.darkGray
}
enum Setting {
enum Font {
static let title = Fonts.regular(size: 17)!
static let subtitle = Fonts.regular(size: 12)!
static let title = Fonts.regular(size: 17)
static let subtitle = Fonts.regular(size: 12)
}
enum Color {
static let background = Colors.appBackground
@ -246,12 +250,12 @@ enum Screen {
enum TokenCard {
enum Font {
static let title: UIFont = Fonts.regular(size: 20)!
static let subtitle = Fonts.regular(size: 12)!
static let blockChainName = Fonts.semibold(size: 12)!
static let valueChangeLabel = Fonts.regular(size: 12)!
static let placeholderLabel = Fonts.regular(size: 17)!
static let valueChangeValue = Fonts.semibold(size: 17)!
static let title: UIFont = Fonts.regular(size: 20)
static let subtitle = Fonts.regular(size: 12)
static let blockChainName = Fonts.semibold(size: 12)
static let valueChangeLabel = Fonts.regular(size: 12)
static let placeholderLabel = Fonts.regular(size: 17)
static let valueChangeValue = Fonts.semibold(size: 17)
}
enum Color {

@ -19,6 +19,6 @@ struct AssetDefinitionsOverridesViewCellViewModel {
let backgroundColor = Colors.appBackground
let textColor = Colors.appText
let textFont = Fonts.light(size: 18)!
let textFont = Fonts.light(size: 18)
let textLineBreakMode = NSLineBreakMode.byTruncatingMiddle
}

@ -146,7 +146,7 @@ class TokensViewController: UIViewController {
if listOfBadTokenScriptFiles.isEmpty {
isConsoleButtonHidden = true
} else {
consoleButton.titleLabel?.font = Fonts.light(size: 22)!
consoleButton.titleLabel?.font = Fonts.light(size: 22)
consoleButton.setTitleColor(Colors.appWhite, for: .normal)
consoleButton.setTitle(R.string.localizable.tokenScriptShowErrors(), for: .normal)
consoleButton.bounds.size.height = 44

@ -8,7 +8,7 @@ struct ImportWalletHelpBubbleViewViewModel {
}
var textFont: UIFont {
return Fonts.semibold(size: 18)!
return Fonts.semibold(size: 18)
}
var descriptionColor: UIColor {
@ -16,6 +16,6 @@ struct ImportWalletHelpBubbleViewViewModel {
}
var descriptionFont: UIFont {
return Fonts.regular(size: 15)!
return Fonts.regular(size: 15)
}
}

@ -28,7 +28,7 @@ struct NewTokenViewModel {
}
var choiceLabelFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var addressLabel: String {

@ -16,10 +16,10 @@ struct OpenSeaNonFungibleTokenAttributeCellViewModel {
}
var nameFont: UIFont {
return Fonts.light(size: 12)!
return Fonts.light(size: 12)
}
var valueFont: UIFont {
return Fonts.semibold(size: 12)!
return Fonts.semibold(size: 12)
}
}

@ -52,6 +52,6 @@ class OpenSeaNonFungibleTokenViewCellViewModel {
}
var titleFont: UIFont {
return Fonts.semibold(size: 10)!
return Fonts.semibold(size: 10)
}
}

@ -50,15 +50,11 @@ struct OpenSeaNonFungibleTokenCardRowViewModel {
}
var titleFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.semibold(size: 13)!
} else {
return Fonts.semibold(size: 17)!
}
return Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 13 : 17)
}
var descriptionFont: UIFont {
return Fonts.light(size: 13)!
return Fonts.light(size: 13)
}
var stateColor: UIColor {
@ -66,15 +62,11 @@ struct OpenSeaNonFungibleTokenCardRowViewModel {
}
var stateFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.semibold(size: 10)!
} else {
return Fonts.semibold(size: 12)!
}
return Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 10: 12)
}
var detailsFont: UIFont {
return Fonts.light(size: 16)!
return Fonts.light(size: 16)
}
var urlButtonText: String {
@ -91,11 +83,7 @@ struct OpenSeaNonFungibleTokenCardRowViewModel {
}
var attributesTitleFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.semibold(size: 11)!
} else {
return Fonts.semibold(size: 15)!
}
return Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 11 : 15)
}
var attributesTitle: String {
@ -123,11 +111,7 @@ struct OpenSeaNonFungibleTokenCardRowViewModel {
}
var subtitleFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.semibold(size: 11)!
} else {
return Fonts.semibold(size: 14)!
}
return Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 11 : 14)
}
var nonFungibleIdIconText: String {
@ -245,7 +229,7 @@ struct OpenSeaNonFungibleTokenCardRowViewModel {
}
var urlButtonFont: UIFont {
return Fonts.semibold(size: 12)!
return Fonts.semibold(size: 12)
}
var urlButtonImage: UIImage {

@ -30,11 +30,11 @@ struct SegmentedControlViewModel {
}
private var unselectedTitleFont: UIFont {
return Fonts.regular(size: 15)!
return Fonts.regular(size: 15)
}
private var selectedTitleFont: UIFont {
return Fonts.semibold(size: 15)!
return Fonts.semibold(size: 15)
}
private var unselectedTitleColor: UIColor {

@ -22,15 +22,15 @@ struct TokenListFormatRowViewModel {
}
var tokenCountFont: UIFont {
return Fonts.bold(size: 21)!
return Fonts.bold(size: 21)
}
var titleFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var descriptionFont: UIFont {
return Fonts.light(size: 16)!
return Fonts.light(size: 16)
}
var stateBackgroundColor: UIColor {
@ -42,15 +42,11 @@ struct TokenListFormatRowViewModel {
}
var subtitleFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.semibold(size: 12)!
} else {
return Fonts.semibold(size: 15)!
}
return Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 12 : 15)
}
var detailsFont: UIFont {
return Fonts.light(size: 16)!
return Fonts.light(size: 16)
}
var urlButtonColor: UIColor {
@ -58,7 +54,7 @@ struct TokenListFormatRowViewModel {
}
var urlButtonFont: UIFont {
return Fonts.light(size: 25)!
return Fonts.light(size: 25)
}
var urlButtonText: String {

@ -36,7 +36,7 @@ struct TokenViewControllerTransactionCellViewModel {
return NSAttributedString(
string: amount,
attributes: [
.font: Fonts.semibold(size: 17)!,
.font: Fonts.semibold(size: 17),
.foregroundColor: transactionViewModel.amountTextColor,
]
)

@ -46,7 +46,7 @@ class TokensCardViewControllerTitleHeader: UIView {
backgroundColor = Colors.appWhite
titleLabel.textColor = Colors.appText
titleLabel.font = Fonts.regular(size: 28)!
titleLabel.font = Fonts.regular(size: 28)
titleLabel.adjustsFontSizeToFitWidth = true
titleLabel.text = title
}

@ -23,7 +23,7 @@ struct ActivityViewModel {
}
var titleFont: UIFont {
Fonts.regular(size: 20)!
Fonts.regular(size: 20)
}
var title: NSAttributedString {
@ -97,11 +97,11 @@ struct ActivityViewModel {
}
var subTitleFont: UIFont {
Fonts.regular(size: 12)!
Fonts.regular(size: 12)
}
var timestampFont: UIFont {
Fonts.regular(size: 12)!
Fonts.regular(size: 12)
}
var timestampColor: UIColor {
@ -140,4 +140,4 @@ struct ActivityViewModel {
return R.image.activityFailed()
}
}
}
}

@ -75,15 +75,15 @@ struct TransactionCellViewModel {
}
var titleFont: UIFont {
return Fonts.regular(size: 17)!
return Fonts.regular(size: 17)
}
var subTitleFont: UIFont {
return Fonts.regular(size: 13)!
return Fonts.regular(size: 13)
}
var amountFont: UIFont {
return Fonts.semibold(size: 14)!
return Fonts.semibold(size: 14)
}
var contentsBackgroundColor: UIColor {
@ -114,7 +114,7 @@ struct TransactionCellViewModel {
return NSAttributedString(
string: amount,
attributes: [
.font: Fonts.light(size: 25)!,
.font: Fonts.light(size: 25),
.foregroundColor: transactionViewModel.amountTextColor,
]
)

@ -19,9 +19,9 @@ struct ChooseTokenCardTransferModeViewControllerViewModel {
var buttonFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.regular(size: 12)!
return Fonts.regular(size: 12)
} else {
return Fonts.regular(size: 15)!
return Fonts.regular(size: 15)
}
}
}

@ -27,7 +27,7 @@ struct ConfirmSignMessageViewControllerViewModel {
}
var actionButtonTitleFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var cancelButtonTitleColor: UIColor {
@ -39,7 +39,7 @@ struct ConfirmSignMessageViewControllerViewModel {
}
var cancelButtonTitleFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var actionButtonTitle: String {
@ -52,7 +52,7 @@ struct ConfirmSignMessageViewControllerViewModel {
}
var singleMessageLabelFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var singleMessageLabelTextColor: UIColor {
@ -60,11 +60,11 @@ struct ConfirmSignMessageViewControllerViewModel {
}
var nameTextFont: UIFont {
return Fonts.semibold(size: 16)!
return Fonts.semibold(size: 16)
}
var valueTextFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var detailsBackgroundBackgroundColor: UIColor {

@ -45,12 +45,12 @@ struct GasSpeedTableViewCellViewModel {
if isSelected {
return NSAttributedString(string: title, attributes: [
.foregroundColor: Colors.black,
.font: Fonts.semibold(size: 17)!
.font: Fonts.semibold(size: 17)
])
} else {
return NSAttributedString(string: title, attributes: [
.foregroundColor: Colors.black,
.font: Fonts.regular(size: 17)!
.font: Fonts.regular(size: 17)
])
}
}
@ -60,14 +60,14 @@ struct GasSpeedTableViewCellViewModel {
return NSAttributedString(string: estimatedTime, attributes: [
.foregroundColor: R.color.mine()!,
.font: Fonts.regular(size: 15)!
.font: Fonts.regular(size: 15)
])
}
var detailsAttributedString: NSAttributedString? {
return NSAttributedString(string: gasFeeString, attributes: [
.foregroundColor: R.color.dove()!,
.font: Fonts.regular(size: 12)!
.font: Fonts.regular(size: 12)
])
}

@ -17,7 +17,7 @@ struct GasSpeedTableViewHeaderViewModel {
var titleAttributedString: NSAttributedString {
return NSAttributedString(string: title, attributes: [
.foregroundColor: R.color.dove()!,
.font: Fonts.regular(size: 15)!
.font: Fonts.regular(size: 15)
])
}

@ -41,7 +41,7 @@ struct RequestViewModel {
}
var copyButtonsFont: UIFont {
return Fonts.semibold(size: 17)!
return Fonts.semibold(size: 17)
}
var labelColor: UIColor? {
@ -49,7 +49,7 @@ struct RequestViewModel {
}
var addressFont: UIFont {
return Fonts.semibold(size: 17)!
return Fonts.semibold(size: 17)
}
var addressBackgroundColor: UIColor {
@ -57,7 +57,7 @@ struct RequestViewModel {
}
var instructionFont: UIFont {
return Fonts.regular(size: 17)!
return Fonts.regular(size: 17)
}
var instructionText: String {

@ -45,7 +45,7 @@ struct SendHeaderViewViewModel {
var titleAttributedString: NSAttributedString {
return NSAttributedString(string: title, attributes: [
.font: Fonts.regular(size: ScreenChecker().isNarrowScreen ? 26 : 36)!,
.font: Fonts.regular(size: ScreenChecker().isNarrowScreen ? 26 : 36),
.foregroundColor: Colors.black
])
}
@ -92,7 +92,7 @@ struct SendHeaderViewViewModel {
let range = NSRange(valuePercentageChangeRange, in: string)
mutableAttributedString.setAttributes([
.font: Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 14 : 17)!,
.font: Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 14 : 17),
.foregroundColor: Screen.TokenCard.Color.valueChangeValue(ticker: ticker)
], range: range)

@ -47,11 +47,11 @@ struct SendViewModel {
return Colors.appGrayLabel
}
var textFieldsLabelFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var recipientLabelFont: UIFont {
return Fonts.regular(size: 13)!
return Fonts.regular(size: 13)
}
var recepientLabelTextColor: UIColor {

@ -13,7 +13,7 @@ struct SendViewSectionHeaderViewModel {
var showTopSeparatorLine: Bool = true
var font: UIFont {
return Fonts.semibold(size: 15)!
return Fonts.semibold(size: 15)
}
var textColor: UIColor {
return R.color.dove()!

@ -22,7 +22,7 @@ struct SetTransferTokensCardExpiryDateViewControllerViewModel {
}
var descriptionLabelFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var descriptionLabelColor: UIColor {
@ -34,7 +34,7 @@ struct SetTransferTokensCardExpiryDateViewControllerViewModel {
}
var noteTitleLabelFont: UIFont {
return Fonts.semibold(size: 21)!
return Fonts.semibold(size: 21)
}
var noteTitleLabelColor: UIColor {
@ -46,7 +46,7 @@ struct SetTransferTokensCardExpiryDateViewControllerViewModel {
}
var noteLabelFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var noteLabelColor: UIColor {
@ -66,7 +66,7 @@ struct SetTransferTokensCardExpiryDateViewControllerViewModel {
}
var choiceLabelFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var linkExpiryDateLabelText: String {

@ -20,7 +20,7 @@ struct TextFieldTableViewCellViewModel {
return NSAttributedString(string: placeholder, attributes: [
.foregroundColor: R.color.dove()!,
.font: Fonts.regular(size: 13)!
.font: Fonts.regular(size: 13)
])
}
}

@ -31,7 +31,7 @@ struct TransactionConfirmationHeaderViewModel {
return NSAttributedString(string: title, attributes: [
.foregroundColor: Colors.black,
.font: Fonts.regular(size: 17)!
.font: Fonts.regular(size: 17)
])
}
@ -40,7 +40,7 @@ struct TransactionConfirmationHeaderViewModel {
return NSAttributedString(string: placeholder, attributes: [
.foregroundColor: R.color.dove()!,
.font: Fonts.regular(size: 13)!
.font: Fonts.regular(size: 13)
])
}
@ -49,7 +49,7 @@ struct TransactionConfirmationHeaderViewModel {
return NSAttributedString(string: details, attributes: [
.foregroundColor: R.color.dove()!,
.font: Fonts.regular(size: 13)!
.font: Fonts.regular(size: 13)
])
}

@ -15,7 +15,7 @@ struct TransactionInProgressViewModel {
return NSAttributedString(string: R.string.localizable.aWalletTokenTransactionInProgressTitle(), attributes: [
.paragraphStyle: style,
.font: Fonts.regular(size: 28)!,
.font: Fonts.regular(size: 28),
.foregroundColor: Colors.black
])
}
@ -28,7 +28,7 @@ struct TransactionInProgressViewModel {
return NSMutableAttributedString(string: x, attributes: [
.paragraphStyle: style,
.font: Fonts.regular(size: 17)!,
.font: Fonts.regular(size: 17),
.foregroundColor: R.color.mine()!
])
}

@ -26,7 +26,7 @@ struct TransferTokensCardQuantitySelectionViewModel {
}
var subtitleFont: UIFont {
return Fonts.regular(size: 10)!
return Fonts.regular(size: 10)
}
var subtitleText: String {

@ -18,7 +18,7 @@ struct TransferTokensCardViaWalletAddressViewControllerViewModel {
}
var targetAddressLabelFont: UIFont {
return Fonts.regular(size: 13)!
return Fonts.regular(size: 13)
}
var targetAddressLabelTextColor: UIColor {

@ -56,7 +56,7 @@ enum ButtonStyle: Int {
.squared,
.border,
.borderless, .system:
return Fonts.semibold(size: 16)!
return Fonts.semibold(size: 16)
}
}

@ -400,7 +400,7 @@ private struct ButtonsBarViewModel {
}
var buttonFont: UIFont {
return Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 16 : 20)!
return Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 16 : 20)
}
var buttonBorderColor: UIColor = R.color.azure()!

@ -44,7 +44,7 @@ class NumberStepper: UIControl {
}
}
public var buttonsFont = Fonts.bold(size: 21)! {
public var buttonsFont = Fonts.bold(size: 21) {
didSet {
for button in [leftButton, rightButton] {
button.titleLabel?.font = buttonsFont

@ -10,7 +10,7 @@ struct StateViewModel {
}
var titleFont: UIFont {
return Fonts.semibold(size: 18)!
return Fonts.semibold(size: 18)
}
var descriptionTextColor: UIColor {
@ -18,7 +18,7 @@ struct StateViewModel {
}
var descriptionFont: UIFont {
return Fonts.regular(size: 16)!
return Fonts.regular(size: 16)
}
var stackSpacing: CGFloat {

@ -48,15 +48,15 @@ extension TokenCardRowViewModelProtocol {
}
var tokenCountFont: UIFont {
return Fonts.bold(size: 21)!
return Fonts.bold(size: 21)
}
var titleFont: UIFont {
return Fonts.light(size: 21)!
return Fonts.light(size: 21)
}
var venueFont: UIFont {
return Fonts.light(size: 16)!
return Fonts.light(size: 16)
}
var stateBackgroundColor: UIColor {
@ -68,15 +68,11 @@ extension TokenCardRowViewModelProtocol {
}
var subtitleFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.semibold(size: 12)!
} else {
return Fonts.semibold(size: 15)!
}
return Fonts.semibold(size: ScreenChecker().isNarrowScreen ? 12 : 15)
}
var detailsFont: UIFont {
return Fonts.light(size: 16)!
return Fonts.light(size: 16)
}
var buttonTitleColor: UIColor {
@ -92,6 +88,6 @@ extension TokenCardRowViewModelProtocol {
}
var buttonFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
}

@ -49,9 +49,9 @@ class AmountTextField: UIControl {
var statusLabelFont: UIFont {
switch self {
case .error:
return Fonts.semibold(size: 13)!
return Fonts.semibold(size: 13)
case .none:
return Fonts.regular(size: 13)!
return Fonts.regular(size: 13)
}
}
@ -113,7 +113,7 @@ class AmountTextField: UIControl {
private lazy var textField: UITextField = {
let textField = UITextField()
textField.attributedPlaceholder = NSAttributedString(string: "0", attributes: [
.font: DataEntry.Font.amountTextField!, .foregroundColor: DataEntry.Color.placeholder
.font: DataEntry.Font.amountTextField, .foregroundColor: DataEntry.Color.placeholder
])
textField.translatesAutoresizingMaskIntoConstraints = false
textField.adjustsFontSizeToFitWidth = true
@ -264,7 +264,7 @@ class AmountTextField: UIControl {
textField.textColor = errorState.textFieldTextColor
textField.attributedPlaceholder = NSAttributedString(string: "0", attributes: [
.font: DataEntry.Font.amountTextField!, .foregroundColor: errorState.textFieldPlaceholderTextColor
.font: DataEntry.Font.amountTextField, .foregroundColor: errorState.textFieldPlaceholderTextColor
])
}
}

@ -18,9 +18,9 @@ struct CreateInitialViewModel {
var subtitleFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
} else {
return Fonts.regular(size: 30)!
return Fonts.regular(size: 30)
}
}
@ -49,7 +49,7 @@ struct CreateInitialViewModel {
}
var alreadyHaveWalletTextFont: UIFont {
return Fonts.regular(size: 18)!
return Fonts.regular(size: 18)
}
var separatorColor: UIColor {

@ -70,14 +70,14 @@ struct ElevateWalletSecurityViewModel {
private var descriptionFont: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.regular(size: 16)!
return Fonts.regular(size: 16)
} else {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
}
var cancelLockingButtonFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var cancelLockingButtonTitleColor: UIColor {

@ -35,7 +35,7 @@ struct ImportWalletViewModel {
}
var importKeystoreJsonButtonFont: UIFont {
return Fonts.regular(size: ScreenChecker().isNarrowScreen ? 16 : 20)!
return Fonts.regular(size: ScreenChecker().isNarrowScreen ? 16 : 20)
}
var importSeedAttributedText: NSAttributedString {
@ -44,7 +44,7 @@ struct ImportWalletViewModel {
return .init(string: R.string.localizable.importWalletImportSeedPhraseDescription(), attributes: [
.paragraphStyle: style,
.font: Fonts.light(size: ScreenChecker().isNarrowScreen ? 14 : 16)!,
.font: Fonts.light(size: ScreenChecker().isNarrowScreen ? 14 : 16),
.foregroundColor: UIColor(red: 116, green: 116, blue: 116)
])
}

@ -18,6 +18,6 @@ struct PassphraseViewModel {
}
var phraseFont: UIFont {
return Fonts.semibold(size: 16)!
return Fonts.semibold(size: 16)
}
}

@ -26,14 +26,14 @@ struct SeedPhraseCellViewModel {
var font: UIFont {
if ScreenChecker().isNarrowScreen {
return Fonts.regular(size: 15)!
return Fonts.regular(size: 15)
} else {
return Fonts.regular(size: 18)!
return Fonts.regular(size: 18)
}
}
var sequenceFont: UIFont {
return Fonts.regular(size: 12)!
return Fonts.regular(size: 12)
}
var sequenceColor: UIColor {

@ -29,7 +29,7 @@ struct ShowSeedPhraseViewModel {
}
var errorFont: UIFont {
return Fonts.regular(size: 18)!
return Fonts.regular(size: 18)
}
var errorMessage: String? {

@ -29,7 +29,7 @@ struct VerifySeedPhraseViewModel {
}
var seedPhraseTextViewFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var seedPhraseTextViewContentInset: UIEdgeInsets {
@ -46,7 +46,7 @@ struct VerifySeedPhraseViewModel {
}
var errorFont: UIFont {
return Fonts.regular(size: 18)!
return Fonts.regular(size: 18)
}
var noErrorText: String {
@ -55,7 +55,7 @@ struct VerifySeedPhraseViewModel {
}
var importKeystoreJsonButtonFont: UIFont {
return Fonts.regular(size: 20)!
return Fonts.regular(size: 20)
}
var subtitleColor: UIColor {

@ -5,7 +5,7 @@ import UIKit
struct OnboardingPageStyle {
var titleFont: UIFont {
return Fonts.light(size: 30)!
return Fonts.light(size: 30)
}
var titleColor: UIColor {

Loading…
Cancel
Save