A
A
Aleksandr Govorukhin2018-06-26 10:14:15
iOS
Aleksandr Govorukhin, 2018-06-26 10:14:15

How to use attributes in strings?

Greetings!
I will immediately explain my question with an example, there is a line:

let simpleText = """
Любые отходы природного происхождения - яичная скорлупа, 
остатки пищи, чайная и кофейная гуща, остатки фруктов и овощей, 
биополимерная упаковка, а также сырые бумажные отходы 
являются биоразлагаемыми компостируемыми материалами.
"""

How to make, for example, the word "waste" (word 2) highlighted in bold? Or any other word to change its size. In the line itself, maybe there are some chips that I have not heard about. The result should be 1 line with words of different sizes or fonts. I know that it is possible through NSMutableAttributedString, but how then to make string concatenation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doublench21, 2018-06-26
@SnapSh0t

5b31fa2a0c079049828645.png5b31f92d59c60257653819.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question