Add a generation option to control use of forward declarations in headers. Swift importing ObjC drops methods/properties if the type is only a forward declaration since the type is incomplete. Historically the generator has always use forward declarations to reduce how much will have rebuild when a proto file does change; but that puts it at odds with Swift. If ObjC Protos end up spanning Swift modules, the Swift import behavior could become a problem; so this option provides a control for the behavior. The current behavior is to continue forward declarations, but eventually the default will be changed. Generate the WKTs using imports instead of forward decls.
diff --git a/objectivec/GPBType.pbobjc.h b/objectivec/GPBType.pbobjc.h index ee02b0a..b023050 100644 --- a/objectivec/GPBType.pbobjc.h +++ b/objectivec/GPBType.pbobjc.h
@@ -4,6 +4,8 @@ #import "GPBDescriptor.h" #import "GPBMessage.h" #import "GPBRootObject.h" +#import "GPBAny.pbobjc.h" +#import "GPBSourceContext.pbobjc.h" #if GOOGLE_PROTOBUF_OBJC_VERSION < 30004 #error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. @@ -19,11 +21,9 @@ CF_EXTERN_C_BEGIN -@class GPBAny; @class GPBEnumValue; @class GPBField; @class GPBOption; -@class GPBSourceContext; NS_ASSUME_NONNULL_BEGIN