Skip to content

Instantly share code, notes, and snippets.

@omayib
Created October 10, 2017 02:53
Show Gist options
  • Save omayib/c71b8114764b146c72eb5043127b09ce to your computer and use it in GitHub Desktop.
Save omayib/c71b8114764b146c72eb5043127b09ce to your computer and use it in GitHub Desktop.
create an implementation of business logic on RegistrationPresenter class.
protocol RegistrationDelegate{
func showProgress()
func hideProgress()
func registrationDidSucceed()
func registrationDidFailed(message: String)
}
class RegistrationPresenter{
var delegate: RegistrationDelegate
init(delegate: RegistrationDelegate) {
self.delegate = delegate
}
func register(email: String, password: String, fullName: String, phoneNumber:String){
if email.isEmpty{
print("omayib")
self.delegate.registrationDidFailed(message: "email can't be blank")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment