Provide protocol for generics

pull/15193/head
Muxi Yan 7 years ago
parent de07d322a2
commit bf0b8798d6
  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"); " */\n");
printer.Print(vars, printer.Print(vars,
"@interface $service_class$ :" "@interface $service_class$ :"
" GRPCProtoService<$service_class$>\n"); " GRPCProtoService<$service_class$, GRPCProtoServiceInit>\n");
printer.Print( printer.Print(
"- (instancetype)initWithHost:(NSString *)host" "- (instancetype)initWithHost:(NSString *)host"
" NS_DESIGNATED_INITIALIZER;\n"); " NS_DESIGNATED_INITIALIZER;\n");

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

Loading…
Cancel
Save