DescriptiveText.swift 750 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // DescriptiveText.swift
  3. // LoopKitUI
  4. //
  5. // Created by Nathaniel Hamming on 2020-02-20.
  6. // Copyright © 2020 LoopKit Authors. All rights reserved.
  7. //
  8. import SwiftUI
  9. public struct DescriptiveText: View {
  10. var label: String
  11. let color: Color
  12. public init(label: String, color: Color = .secondary) {
  13. self.label = label
  14. self.color = color
  15. }
  16. public var body: some View {
  17. Text(label)
  18. .font(.footnote)
  19. .foregroundColor(color)
  20. }
  21. }
  22. struct DescriptiveText_Previews: PreviewProvider {
  23. static var previews: some View {
  24. DescriptiveText(label: "Descriptive text is typically lengthly and provides additional details to potentially terse labeled values.")
  25. }
  26. }