Merge pull request #15193 from muxi/service-init-protocol

Provide protocol for initializer of generated messages
pull/15249/head
Muxi Yan 7 years ago committed by GitHub
commit 83601d6b4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/compiler/objective_c_generator.cc
  2. 6
      src/objective-c/ProtoRPC/ProtoService.h

@ -248,7 +248,7 @@ void PrintMethodImplementations(Printer* printer,
" */\n");
printer.Print(vars,
"@interface $service_class$ :"
" GRPCProtoService<$service_class$>\n");
" GRPCProtoService<$service_class$, GRPCProtoServiceInit>\n");
printer.Print(
"- (instancetype)initWithHost:(NSString *)host"
" NS_DESIGNATED_INITIALIZER;\n");

@ -22,6 +22,12 @@
@protocol GRXWriteable;
@class GRXWriter;
@protocol GRPCProtoServiceInit
- (instancetype)initWithHost:(NSString *)host;
@end
__attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoService
: NSObject -
(instancetype)initWithHost : (NSString *)host packageName

Loading…
Cancel
Save