diff options
Diffstat (limited to 'objectivec/GPBWellKnownTypes.h')
-rw-r--r-- | objectivec/GPBWellKnownTypes.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/objectivec/GPBWellKnownTypes.h b/objectivec/GPBWellKnownTypes.h index 90d96c6f..04df4178 100644 --- a/objectivec/GPBWellKnownTypes.h +++ b/objectivec/GPBWellKnownTypes.h @@ -112,16 +112,27 @@ typedef NS_ENUM(NSInteger, GPBWellKnownTypesErrorCode) { * @note: Not all second/nanos combinations can be represented in a * NSTimeInterval, so getting this could be a lossy transform. **/ -@property(nonatomic, readwrite) NSTimeInterval timeIntervalSince1970; +@property(nonatomic, readwrite) NSTimeInterval timeInterval; /** * Initializes a GPBDuration with the given NSTimeInterval. * - * @param timeIntervalSince1970 Time interval to configure the GPBDuration with. + * @param timeInterval Time interval to configure the GPBDuration with. * * @return A newly initialized GPBDuration. **/ -- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970; +- (instancetype)initWithTimeInterval:(NSTimeInterval)timeInterval; + +// These next two methods are deprecated because GBPDuration has no need of a +// "base" time. The older methods were about symmetry with GBPTimestamp, but +// the unix epoch usage is too confusing. + +/** Deprecated, use timeInterval instead. */ +@property(nonatomic, readwrite) NSTimeInterval timeIntervalSince1970 + __attribute__((deprecated("Use timeInterval"))); +/** Deprecated, use initWithTimeInterval: instead. */ +- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970 + __attribute__((deprecated("Use initWithTimeInterval:"))); @end |