iosswiftsvprogresshud

SVProgressHud Ring/Foreground Color IOS


I now this issue posted more times but i have not fix my issue. In my case foregroundColor is not working. Ring is not appear with darkGray color even that foregroundColor not pick any color. Please View my code and help me. Thanks

import SVProgressHUD
//import SVProgressHud on top

SVProgressHUD.setDefaultStyle(.custom)
SVProgressHUD.setDefaultMaskType(.custom)
SVProgressHUD.setMinimumSize(CGSize(width: 60, height: 60))
SVProgressHUD.setRingThickness(3)
SVProgressHUD.setRingNoTextRadius(20)
SVProgressHUD.setBackgroundColor(UIColor.white)
SVProgressHUD.setForegroundColor(UIColor.darkGray)
SVProgressHUD.show()

ScreenShot of my SVProgressHud


Solution

  • Just call this method only.

    SVProgressHUD.setDefaultStyle(.custom)
    SVProgressHUD.setDefaultMaskType(.custom)
    SVProgressHUD.setForegroundColor(UIColor.red)           //Ring Color
    SVProgressHUD.setBackgroundColor(UIColor.yellow)        //HUD Color
    SVProgressHUD.setBackgroundLayerColor(UIColor.green)    //Background Color
    SVProgressHUD.show()
    

    getting output like this