Skip to content

Instantly share code, notes, and snippets.

@omayib
Last active December 12, 2016 22:35
Show Gist options
  • Save omayib/d40a7e5e8395ba6388574f8644ef7797 to your computer and use it in GitHub Desktop.
Save omayib/d40a7e5e8395ba6388574f8644ef7797 to your computer and use it in GitHub Desktop.
spaghetti code loading view was spread in almost view controller.
import SJProgressHUD
//import anything
//we also put SJProgressHUD in almost ViewController which need to render loading view.
class LoginVC: UIViewController {
func viewDidLoad(){
//other code here...
}
func buttonTapped(){
//other logic here...
SJProgressHUD.show(...)
}
func functionThatNeedToShowPopupError(){
//other code here... blahblah blah
SJProgressHUD.showError(...)
}
func otherFunction(){
//other code here... @!(njdn910>!
SJProgressHUD.hide()
//and code again here...wtf!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment