Skip to content

Instantly share code, notes, and snippets.

@SergLam
Created April 3, 2019 11:39
Show Gist options
  • Save SergLam/17e79128e374da4b446df5d5e6313eea to your computer and use it in GitHub Desktop.
Save SergLam/17e79128e374da4b446df5d5e6313eea to your computer and use it in GitHub Desktop.
PKHUD Custom layout
fileprivate func showImageLoadingProgress() {
let imageSize = CGSize(width: UIScreen.width / 2, height: UIScreen.width / 2)
let imageLoadingProgressView = UIImageView(frame: CGRect(origin: CGPoint.zero, size: imageSize))
PKHUD.sharedHUD.contentView = imageLoadingProgressView
let fileName = R.image.imageLoaderGif.name.replacingOccurrences(of: ".gif", with: "")
imageLoadingProgressView.loadGif(name: fileName)
PKHUD.sharedHUD.show()
}
fileprivate func hideImageLoadingProgress(_ completion: @escaping VoidClosure) {
PKHUD.sharedHUD.hide(true) { (_) in
completion()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment