diff options
Diffstat (limited to 'objectivec/GPBWellKnownTypes.h')
-rw-r--r-- | objectivec/GPBWellKnownTypes.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/objectivec/GPBWellKnownTypes.h b/objectivec/GPBWellKnownTypes.h index 311ac58e..96d51d9e 100644 --- a/objectivec/GPBWellKnownTypes.h +++ b/objectivec/GPBWellKnownTypes.h @@ -46,18 +46,54 @@ NS_ASSUME_NONNULL_BEGIN -// Extension to GPBTimestamp to work with standard Foundation time/date types. +/** + * Category for GPBTimestamp to work with standard Foundation time/date types. + **/ @interface GPBTimestamp (GBPWellKnownTypes) + +/** The NSDate representation of this GPBTimestamp. */ @property(nonatomic, readwrite, strong) NSDate *date; + +/** The NSTimeInterval representation of this GPBTimestamp. */ @property(nonatomic, readwrite) NSTimeInterval timeIntervalSince1970; + +/** + * Initializes a GPBTimestamp with the given NSDate. + * + * @param date The date to configure the GPBTimestamp with. + * + * @return A newly initialized GPBTimestamp. + **/ - (instancetype)initWithDate:(NSDate *)date; + +/** + * Initializes a GPBTimestamp with the given NSTimeInterval. + * + * @param timeIntervalSince1970 Time interval to configure the GPBTimestamp with. + * + * @return A newly initialized GPBTimestamp. + **/ - (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970; + @end -// Extension to GPBDuration to work with standard Foundation time type. +/** + * Category for GPBDuration to work with standard Foundation time type. + **/ @interface GPBDuration (GBPWellKnownTypes) + +/** The NSTimeInterval representation of this GPBTimestamp. */ @property(nonatomic, readwrite) NSTimeInterval timeIntervalSince1970; + +/** + * Initializes a GPBDuration with the given NSTimeInterval. + * + * @param timeIntervalSince1970 Time interval to configure the GPBDuration with. + * + * @return A newly initialized GPBTimestamp. + **/ - (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970; + @end NS_ASSUME_NONNULL_END |