-
-
Save edopelawi/6487ef424fc89d7c2312 to your computer and use it in GitHub Desktop.
A common mistake on network-service method that takes raw objects instead of models, resulting on really big parameters.
This file contains 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
/// The result of this method will be sent via the @p RACSignal. Well, you can add more parameters if you want to... | |
- (RACSignal *)registerNewUserWithName:(NSString *)name | |
password:(NSString *)password | |
email:(NSString *)email | |
address:(NSString *)address | |
{ | |
// Add your usual parameter validation here... | |
NSDictionary *payload = @{ | |
@"user_name": name, | |
@"password": password, | |
@"email": email, | |
@"address": address | |
}; | |
// More logic or network call here... | |
return networkRequestSignal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment