5

i am using the following code but not showing progress hud so please help for that.simple hud showing fine but customise not showing

let loadingHUD = MBProgressHUD() loadingHUD.mode = MBProgressHUDModeCustomView loadingHUD.labelText = nil loadingHUD.detailsLabelText = nil let customView = UIView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) let gifmanager = SwiftyGifManager(memoryLimit:20) let gif = UIImage(gifName: "miniballs1.gif") let imageview = UIImageView(gifImage: gif, manager: gifmanager) imageview.frame = CGRect(x: 0 , y: 0, width: customView.frame.width, height: customView.frame.height) customView.addSubview(imageview) customView.bringSubview(toFront: imageview) loadingHUD.customView = customView loadingHUD.customView.bringSubview(toFront: customView) loadingHUD.show(true) 
3
  • Try this HUD library for iOS in swift github.com/shubh10/JustHUD Commented Jul 20, 2017 at 7:25
  • thanks .. but's i have solved this issue and working for me fine Commented Jul 20, 2017 at 7:27
  • That's great. That is my library though, try it when you get time. Feel free to share it with your friends and add new features. Commented Jul 20, 2017 at 9:54

3 Answers 3

5
+100

Try with this library ACProgressHud-Swift

In xib file whatever view make then customise and use it.

For Show

ACProgressHUD.shared.showHUD(withStatus: “Your Message Name“) 

For hide

ACProgressHUD.shared.hideHUD() 
Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the answer.this is easy to use HUD . i integrate in my project and working fine.
4

I Solved This Problem In Swift 3

 var hud = MBProgressHUD() hud.backgroundColor = UIColor.clear // Set an image view with a checkmark. let gifmanager = SwiftyGifManager(memoryLimit:20) let gif = UIImage(gifName: "eclipse.gif") let imageview = UIImageView(gifImage: gif, manager: gifmanager) hud.labelText = NSLocalizedString(string, comment: "") hud.labelColor = UIColor.red imageview.frame = CGRect(x: 0 , y: 0, width: 80 , height: 80) let views = UIView.init(frame: CGRect(x: 0 , y: 0, width: 80 , height: 80)) views.backgroundColor = UIColor.black views.addSubview(imageview) hud.customView = views hud.customView.backgroundColor = UIColor.clear hud.dimBackground = true hud.show(true) 

1 Comment

Try this HUD library for iOS in swift github.com/shubh10/JustHUD
0
import UIKit class Loader: NSObject { class func setup() { MBProgressHUD.setDefaultMaskType(.Black) MBProgressHUD.setBackgroundColor(UIColor(white: 0, alpha: 0.7)) MBProgressHUD.setForegroundColor(UIColor(white: 1, alpha: 1)) } class func Show(message:String = "loading..."){ MBProgressHUD.showWithStatus(message) UIApplication.sharedApplication().networkActivityIndicatorVisible = true } class func Hide(){ MBProgressHUD.dismiss() UIApplication.sharedApplication().networkActivityIndicatorVisible = false } } 

Make a class of MBProgressHUD and use it as Loader.Show() Or you can customise it as per your requirement

1 Comment

I Want to use MBProgressHudCustom View Use And For this type loading animation already work for me

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.