AWFTimeDependent

Objective-C

@protocol AWFTimeDependent <NSObject>

Swift

protocol AWFTimeDependent : NSObjectProtocol

The AWFTimeDependent protocol defines the properties and methods used by objects whose data is specific to a particular time and/or date.

  • The date for the object.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDate *_Nonnull date;

    Swift

    var date: Date { get set }
  • The time offset string relative to now (e.g. -10minutes, +1hour, etc).

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *_Nonnull offset;

    Swift

    var offset: String { get set }
  • Updates the object and its data representation using the specified date.

    Declaration

    Objective-C

    - (void)updateForDateClosestToDate:(nonnull NSDate *)date
                        updatingOffset:(BOOL)updateOffset;

    Swift

    func updateForDateClosest(to date: Date, updatingOffset updateOffset: Bool)

    Parameters

    date

    The date to update the object with

    updateOffset

    Whether or not the object’s offset should also be updated using the date