Changing Text Attribute Strings From The Attribute Inspector In Swift

Updated 27 December 2021

Save

Hello guys, Today we learn about Changing Text Attribute Strings From The Attribute Inspector In Swift.

What is Attribute String:

Attribute strings are a set of character strings that have an individual character or range of characters. for more details please Click Here.


Getting Start:-


step1:- Firstly, create a new Xcode project.

File-> New-> Project-> Choose Ios-> choose App-> next and Add your project name then create.


Step2:- Then, create the design of the label on the storyboard

  1. Firstly, drag and drop the label on View Storyboad.

2. Then, select the label and go to the Attribute inspector section

And select label text Plain to Attribute

3. Now you can change your text accordingly.

For example:- If you want to change the color of the first word then you can just select the word and change the color or you can change the color of a character as well, Please see attached video

And, if you want to change the text in bold, underline, the italic format you need to just select the text and change the text into bold, underline e.t.c

Here are the two methods, just simply click on the T button, here you have a font box

  1. First, by using the font box, you can change the selected text size, change the text to bold, and italic attributes. Also you can change the text language. Please see attached video.

2. second, you just simply select the particular text and right-click and change the font to bold, underline, italic

Now, run your project and see the result-

Conclusion:-

In this blog, we discussed Changing text attribute strings from the storyboard attribute inspector in Swift

I hope this blog will help you to understand the attribute functionality of the storyboard.

Thanks for reading!!!

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home