Digital ACT-191 ONEAPP-9314 story: added missed comments
This commit is contained in:
parent
1bd58256f7
commit
e5d9f77d3d
@ -153,6 +153,7 @@ open class PriceLockup: View {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
internal var containerSize: CGSize { CGSize(width: 45, height: 44) }
|
internal var containerSize: CGSize { CGSize(width: 45, height: 44) }
|
||||||
|
|
||||||
|
// TextStyle for the size.
|
||||||
private var textStyle: TextStyle.StandardStyle {
|
private var textStyle: TextStyle.StandardStyle {
|
||||||
switch (size, textPosition) {
|
switch (size, textPosition) {
|
||||||
case (.xxxsmall, .preDelimiter), (.xxxsmall, .postDelimiter):
|
case (.xxxsmall, .preDelimiter), (.xxxsmall, .postDelimiter):
|
||||||
@ -228,6 +229,7 @@ open class PriceLockup: View {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Methods
|
// MARK: - Private Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
// Update PriceLockup text attributes
|
||||||
func updateLabelAttributes() {
|
func updateLabelAttributes() {
|
||||||
var attributes: [any LabelAttributeModel] = []
|
var attributes: [any LabelAttributeModel] = []
|
||||||
attributes.append(ColorLabelAttribute(location: 0,
|
attributes.append(ColorLabelAttribute(location: 0,
|
||||||
@ -242,6 +244,7 @@ open class PriceLockup: View {
|
|||||||
textStyle: bold ? textStyle.bold : textStyle.regular,
|
textStyle: bold ? textStyle.bold : textStyle.regular,
|
||||||
textPosition: .left))
|
textPosition: .left))
|
||||||
attributes.append(StrikeThroughLabelAttribute(location:strikethroughLocation, length: strikethroughLength))
|
attributes.append(StrikeThroughLabelAttribute(location:strikethroughLocation, length: strikethroughLength))
|
||||||
|
|
||||||
} else if uniformSize {
|
} else if uniformSize {
|
||||||
|
|
||||||
// currency and value have the same font text style as delimeter, term, trailing text and superscript.
|
// currency and value have the same font text style as delimeter, term, trailing text and superscript.
|
||||||
@ -249,6 +252,7 @@ open class PriceLockup: View {
|
|||||||
length: priceLockupLabel.text.count,
|
length: priceLockupLabel.text.count,
|
||||||
textStyle: bold ? textStyle.bold : textStyle.regular,
|
textStyle: bold ? textStyle.bold : textStyle.regular,
|
||||||
textPosition: .left))
|
textPosition: .left))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// size updates relative to predelimiter, postdelimiter
|
// size updates relative to predelimiter, postdelimiter
|
||||||
@ -269,6 +273,7 @@ open class PriceLockup: View {
|
|||||||
priceLockupLabel.attributes = attributes
|
priceLockupLabel.attributes = attributes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get text for PriceLockup.
|
||||||
open func fetchText() -> String {
|
open func fetchText() -> String {
|
||||||
var text : String = ""
|
var text : String = ""
|
||||||
let space = " "
|
let space = " "
|
||||||
@ -302,6 +307,6 @@ open class PriceLockup: View {
|
|||||||
extension Float {
|
extension Float {
|
||||||
// remove a decimal from a float if the decimal is equal to 0
|
// remove a decimal from a float if the decimal is equal to 0
|
||||||
var clean: String {
|
var clean: String {
|
||||||
return self.truncatingRemainder(dividingBy: 1) == 0 ? String(format: "%.0f", self) : String(self)
|
return self.truncatingRemainder(dividingBy: 1) == 0 ? String(format: "%.0f", self) : String(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user