MGLEvent
@interface MGLEvent : NSObject
Generic Event used when notifying an MGLObserver
. This is not intended nor
expected to be created by the application developer. It will be provided as
part of an MGLObservable
notification.
-
Type of an event. Matches an original event type used for a subscription.
Declaration
Objective-C
@property (readonly, copy, nonatomic) MGLEventType _Nonnull type;
Swift
var type: MGLEventType { get }
-
Timestamp taken at the time of an event creation, relative to the Unix epoch.
Declaration
Objective-C
@property (readonly, nonatomic) NSTimeInterval begin;
Swift
var begin: TimeInterval { get }
-
Timestamp taken at the time of an event completion. For a non-interval (single-shot) events, migth be equal to an event’s
begin
timestamp. Relative to the Unix epoch.Declaration
Objective-C
@property (readonly, nonatomic) NSTimeInterval end;
Swift
var end: TimeInterval { get }
-
Generic property for the event’s data. Supported types are:
NSNumber
(int64, uint64, bool, double),NSString
,NSArray
,NSDictionary
.Declaration
Objective-C
@property (readonly, copy, nonatomic) id _Nonnull data;
Swift
var data: Any { get }
-
Test for equality. Note this compares all properties except
data
.Declaration
Objective-C
- (BOOL)isEqualToEvent:(nonnull MGLEvent *)otherEvent;
Swift
func isEqual(to otherEvent: MGLEvent) -> Bool