This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
95 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// Library | ||
// | ||
// Created by 0 on 14.11.19. | ||
// Copyright © 2019 Zap. All rights reserved. | ||
// | ||
|
||
import Bond | ||
import Foundation | ||
|
||
final class CurrencySwitchLabel: PaddingLabel { | ||
private let minSize: CGFloat = 24 | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
edgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
edgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5) | ||
} | ||
|
||
override func prepareForInterfaceBuilder() { | ||
super.prepareForInterfaceBuilder() | ||
invalidateIntrinsicContentSize() | ||
} | ||
|
||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
|
||
backgroundColor = UIColor.Zap.seaBlue | ||
|
||
textColor = UIColor.Zap.lightningOrange | ||
font = .systemFont(ofSize: 17, weight: .medium) | ||
textAlignment = .center | ||
setContentCompressionResistancePriority(.required, for: .horizontal) | ||
|
||
Settings.shared.primaryCurrency | ||
.map { $0.symbol } | ||
.bind(to: reactive.text) | ||
.dispose(in: reactive.bag) | ||
|
||
NSLayoutConstraint.activate([ | ||
heightAnchor.constraint(equalToConstant: minSize), | ||
widthAnchor.constraint(greaterThanOrEqualToConstant: minSize) | ||
]) | ||
|
||
layer.cornerRadius = 5 | ||
layer.masksToBounds = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule SwiftBTC
updated
4 files
+18 −18 | Gemfile.lock | |
+5 −1 | SwiftBTC/Classes/Bitcoin.swift | |
+2 −1 | SwiftBTC/Classes/Currency.swift | |
+18 −4 | SwiftBTC/Classes/FiatCurrency.swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters