mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-04 03:08:43 +00:00
Make iOS settings more idiomatic in some small ways: shorter labels, use of footers, etc.
This commit is contained in:
1 parent
7ed45c370b
commit
f027a0f1d5
6 files changed
+58
-77
No files matched your search
@@ -59,27 +59,17 @@ private extension CopyableLabel {
|
||||
|
||||
// MARK: - SwiftUI
|
||||
|
||||
/// SwiftUI wrapper for `CopyableLabel`. Defaults to centered, secondary-colored body text.
|
||||
/// SwiftUI wrapper for `CopyableLabel`: centered, secondary-colored body text.
|
||||
struct CopyableText: UIViewRepresentable {
|
||||
|
||||
let text: String
|
||||
let font: UIFont
|
||||
let textColor: UIColor
|
||||
let textAlignment: NSTextAlignment
|
||||
|
||||
init(text: String, font: UIFont = UIFont.preferredFont(forTextStyle: .body), textColor: UIColor = UIColor.secondaryLabel, textAlignment: NSTextAlignment = .center) {
|
||||
self.text = text
|
||||
self.font = font
|
||||
self.textColor = textColor
|
||||
self.textAlignment = textAlignment
|
||||
}
|
||||
|
||||
func makeUIView(context: Context) -> CopyableLabel {
|
||||
let label = CopyableLabel()
|
||||
label.font = font
|
||||
label.font = UIFont.preferredFont(forTextStyle: .body)
|
||||
label.adjustsFontForContentSizeCategory = true
|
||||
label.textColor = textColor
|
||||
label.textAlignment = textAlignment
|
||||
label.textColor = UIColor.secondaryLabel
|
||||
label.textAlignment = .center
|
||||
label.numberOfLines = 0
|
||||
return label
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user