0

I am trying to help changing some styling in an IOS-application developed using Swift and with a storyboard.

This is how the page look

Application page

and the product owner would like to make the findtoilet@findtoilet.dk larger, but it seems that changing the font and styling in the storyboard has no effect because IOS decides the formatting of the email

page from XCode 12

Any ideas?

  • You should try atributed text programatically. – Kudos Aug 03 '21 at 05:56
  • Thank you. That gave me just the push I needed. I had tried that but got a lot of compile errors, just looking like the samples was from a different platform or a different compiler. But a search gave me this https://stackoverflow.com/questions/11031623/can-i-set-the-attributedtext-property-of-uilabel and using the lines from that sample made me realize that it would update the field with the attributes I had defined on the storyboard :) – Thorvald Byskov Aagaard Aug 03 '21 at 18:24

1 Answers1

0

Using this

// Define general attributes for the entire text
NSDictionary *attribs = @{
                          NSForegroundColorAttributeName: self.label.textColor,
                          NSFontAttributeName: self.label.font
                          };
NSMutableAttributedString *attributedText = 
    [[NSMutableAttributedString alloc] initWithString:text
                                           attributes:attribs];

Will take the style defined for the label on the storyboard and apply that, thus overruling IOS-styling for a tappable link