TvOSTextViewer icon indicating copy to clipboard operation
TvOSTextViewer copied to clipboard

Create attributes text

Open paoloandrea opened this issue 3 years ago • 0 comments

Hi, I created the "attributes" variable to allow users to insert other elements in the text field that opens full screen.

For example, if I assign attributes to the simple text field, I can add a title of a different font and color compared to the description. Just like in other tvOS apps.

import SwiftyAttributes ... let title = title! .withAttributes ([ .font (.title1), .textColor (.white) ])

let overview = text! .withAttributes ([ .font (.body), .textColor (.white) ]) viewController.attributes = title + breakline + overview

paoloandrea avatar Mar 09 '22 23:03 paoloandrea