0

Would you please advice me how to create an Activity Indicator View? I have a normal button:

@IBAction func NextViewController(sender: AnyObject) {


}

it takes lots of time until my app loads the next view controller and I would like to have a normal indicator which will inform the users to wait a bit.

2

1 Answer 1

1

I can advice you to use the LilithProgressHUD. It's the best Activity Indicator View I have ever used.

enter image description here

Install it with pod 'LilithProgressHUD'.

//Import LilithProgressHUD
import LilithProgressHUD

//Show the HUD
LilithProgressHUD.show()

//Hide the HUD
LilithProgressHUD.hide()

That is literally it...

So in your example:

@IBAction func NextViewController(sender: AnyObject) {

     LilithProgressHUD.show()
}

That would be it... At the NextViewController viewDidLoad you would then call LilithProgressHUD.hide().

Also. I have set the properties of the view within my AppDelegate.

LilithProgressHUD.size = (self.window?.frame.size.height)! // sets the size to the size of my App
LilithProgressHUD.opacity = 0.75 // sets the opacity nice to a value where you can slightly see the App
Sign up to request clarification or add additional context in comments.

10 Comments

hey would you please tell me where can I download this LilithProgressHUD.swift I cant find it
here is the github link
i recommend you install it via cocoapods. then you can update easily to newer versions
Yes I downloaded the whole project but I cant find .swift file :(
I am beginner I will need some help can I text you in the chat ?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.