Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3414dc1

Browse files
thomasvlcopybara-github
authored andcommitted
[ObjC] Remove -[GPBFieldDescriptor optional]
As announced: https://protobuf.dev/news/2025-09-19/#objc-remove-apis Removing the deprecated api as part of the ObjC Major Version bump coming in 2026Q1. PiperOrigin-RevId: 815768697
1 parent 9a9d8d2 commit 3414dc1

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

objectivec/GPBDescriptor.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ __attribute__((objc_subclassing_restricted))
172172
@property(nonatomic, readonly) GPBGenericValue defaultValue;
173173
/** Whether this field is required. Only valid for proto2 fields. */
174174
@property(nonatomic, readonly, getter=isRequired) BOOL required;
175-
/** Whether this field is optional. */
176-
@property(nonatomic, readonly, getter=isOptional) BOOL optional DEPRECATED_MSG_ATTRIBUTE(
177-
"Check if fieldType is GPBFieldTypeSingle and that it is NOT required.");
178175
/** Type of field (single, repeated, map). */
179176
@property(nonatomic, readonly) GPBFieldType fieldType;
180177
/** Type of the key if the field is a map. The value's type is -dataType. */

objectivec/GPBDescriptor.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -630,13 +630,6 @@ - (BOOL)isRequired {
630630
return (description_->flags & GPBFieldRequired) != 0;
631631
}
632632

633-
#pragma clang diagnostic push
634-
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
635-
- (BOOL)isOptional {
636-
return self.fieldType == GPBFieldTypeSingle && !self.isRequired;
637-
}
638-
#pragma clang diagnostic pop
639-
640633
- (GPBFieldType)fieldType {
641634
GPBFieldFlags flags = description_->flags;
642635
if ((flags & GPBFieldRepeated) != 0) {

0 commit comments

Comments
 (0)