Created
October 10, 2017 02:53
-
-
Save omayib/c71b8114764b146c72eb5043127b09ce to your computer and use it in GitHub Desktop.
create an implementation of business logic on RegistrationPresenter class.
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
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