Last active
December 12, 2016 22:35
-
-
Save omayib/d40a7e5e8395ba6388574f8644ef7797 to your computer and use it in GitHub Desktop.
spaghetti code loading view was spread in almost view controller.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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