Check Mobile App
Read now
Start a Project

Set Activity Indicator in UIButton in Swift 3


Activity Indicator in UIButton

Some times we need to perform some action on clicking the button , and we have to wait for some time  for respective result.Generally we use loader in middle of screen after data will come we close the loader. we can also show the loader on that where we have clicked and when the data will come we stop the loader and set the default text on UIButton which was previously set.

For this we need to follow some steps:

1: Take UIButton from StoryBoard.

2: Now select UIButton , and click on “Show the identity Inspector

3: Now In Class write the custom class Name “LoadingButton

4: Now Define This Class:

5: Now its time to use :

6: Crate the outlet as action of UIButton:

7: Now In this function you can use any kind of call or function, and when the result will come


8: When it will stop , it will showing the default title in button.











. . .

Leave a Comment

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

Be the first to comment.


Great Product, Great Team, and Great Support Service. And if you want to add more features to the product, they can submit any idea that comes to your mind. They really care about their clients and we are really happy and honored to deal with Webkul.

Talk to Sales


Live Chat
Start a Project

    Message Sent!

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

    Back to Home