Skip to content

Commit 1c3073d

Browse files
Update CountlyEvent.m
1 parent b4cc8dd commit 1c3073d

File tree

1 file changed

+66
-66
lines changed

1 file changed

+66
-66
lines changed

CountlyEvent.m

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -8,82 +8,82 @@
88

99
@implementation CountlyEvent
1010

11-
NSString *const kCountlyEventKeyKey = @"key";
12-
NSString *const kCountlyEventKeyID = @"id";
13-
NSString *const kCountlyEventKeyCVID = @"cvid";
14-
NSString *const kCountlyEventKeyPVID = @"pvid";
15-
NSString *const kCountlyEventKeyPEID = @"peid";
16-
NSString *const kCountlyEventKeySegmentation = @"segmentation";
17-
NSString *const kCountlyEventKeyCount = @"count";
18-
NSString *const kCountlyEventKeySum = @"sum";
19-
NSString *const kCountlyEventKeyTimestamp = @"timestamp";
20-
NSString *const kCountlyEventKeyHourOfDay = @"hour";
21-
NSString *const kCountlyEventKeyDayOfWeek = @"dow";
22-
NSString *const kCountlyEventKeyDuration = @"dur";
11+
NSString* const kCountlyEventKeyKey = @"key";
12+
NSString* const kCountlyEventKeyID = @"id";
13+
NSString* const kCountlyEventKeyCVID = @"cvid";
14+
NSString* const kCountlyEventKeyPVID = @"pvid";
15+
NSString* const kCountlyEventKeyPEID = @"peid";
16+
NSString* const kCountlyEventKeySegmentation = @"segmentation";
17+
NSString* const kCountlyEventKeyCount = @"count";
18+
NSString* const kCountlyEventKeySum = @"sum";
19+
NSString* const kCountlyEventKeyTimestamp = @"timestamp";
20+
NSString* const kCountlyEventKeyHourOfDay = @"hour";
21+
NSString* const kCountlyEventKeyDayOfWeek = @"dow";
22+
NSString* const kCountlyEventKeyDuration = @"dur";
2323

24-
/**
25-
* This function is a critical component used within the `CountlyPersistency.serializeRecordedEvents` method.
26-
*
27-
* Note: If this function is modified, ensure that corresponding updates are made to
28-
* the `CountlyPersistency.serializeRecordedEvents` method to maintain consistency and prevent potential issues.
29-
*
30-
* @warning Changes to this function may have downstream effects. Proceed with caution.
31-
*/
24+
/**
25+
* This function is a critical component used within the `CountlyPersistency.serializeRecordedEvents` method.
26+
*
27+
* Note: If this function is modified, ensure that corresponding updates are made to
28+
* the `CountlyPersistency.serializeRecordedEvents` method to maintain consistency and prevent potential issues.
29+
*
30+
* @warning Changes to this function may have downstream effects. Proceed with caution.
31+
*/
3232
- (NSDictionary *)dictionaryRepresentation
3333
{
34-
NSMutableDictionary *eventData = NSMutableDictionary.dictionary;
35-
eventData[kCountlyEventKeyKey] = self.key;
36-
if (self.segmentation)
37-
{
38-
eventData[kCountlyEventKeySegmentation] = self.segmentation;
39-
}
40-
eventData[kCountlyEventKeyID] = self.ID;
41-
eventData[kCountlyEventKeyCVID] = self.CVID;
42-
eventData[kCountlyEventKeyPVID] = self.PVID;
43-
eventData[kCountlyEventKeyPEID] = self.PEID;
44-
eventData[kCountlyEventKeyCount] = @(self.count);
45-
eventData[kCountlyEventKeySum] = @(self.sum);
46-
eventData[kCountlyEventKeyTimestamp] = @((long long)(self.timestamp * 1000));
47-
eventData[kCountlyEventKeyHourOfDay] = @(self.hourOfDay);
48-
eventData[kCountlyEventKeyDayOfWeek] = @(self.dayOfWeek);
49-
eventData[kCountlyEventKeyDuration] = @(self.duration);
50-
return eventData;
34+
NSMutableDictionary* eventData = NSMutableDictionary.dictionary;
35+
eventData[kCountlyEventKeyKey] = self.key;
36+
if (self.segmentation)
37+
{
38+
eventData[kCountlyEventKeySegmentation] = self.segmentation;
39+
}
40+
eventData[kCountlyEventKeyID] = self.ID;
41+
eventData[kCountlyEventKeyCVID] = self.CVID;
42+
eventData[kCountlyEventKeyPVID] = self.PVID;
43+
eventData[kCountlyEventKeyPEID] = self.PEID;
44+
eventData[kCountlyEventKeyCount] = @(self.count);
45+
eventData[kCountlyEventKeySum] = @(self.sum);
46+
eventData[kCountlyEventKeyTimestamp] = @((long long)(self.timestamp * 1000));
47+
eventData[kCountlyEventKeyHourOfDay] = @(self.hourOfDay);
48+
eventData[kCountlyEventKeyDayOfWeek] = @(self.dayOfWeek);
49+
eventData[kCountlyEventKeyDuration] = @(self.duration);
50+
return eventData;
5151
}
5252

5353
- (instancetype)initWithCoder:(NSCoder *)decoder
5454
{
55-
if (self = [super init])
56-
{
57-
self.key = [decoder decodeObjectForKey:NSStringFromSelector(@selector(key))];
58-
self.ID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(ID))];
59-
self.CVID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(CVID))];
60-
self.PVID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(PVID))];
61-
self.PEID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(PEID))];
62-
self.segmentation = [decoder decodeObjectForKey:NSStringFromSelector(@selector(segmentation))];
63-
self.count = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(count))];
64-
self.sum = [decoder decodeDoubleForKey:NSStringFromSelector(@selector(sum))];
65-
self.timestamp = [decoder decodeDoubleForKey:NSStringFromSelector(@selector(timestamp))];
66-
self.hourOfDay = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(hourOfDay))];
67-
self.dayOfWeek = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(dayOfWeek))];
68-
self.duration = [decoder decodeDoubleForKey:NSStringFromSelector(@selector(duration))];
69-
}
70-
71-
return self;
55+
if (self = [super init])
56+
{
57+
self.key = [decoder decodeObjectForKey:NSStringFromSelector(@selector(key))];
58+
self.ID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(ID))];
59+
self.CVID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(CVID))];
60+
self.PVID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(PVID))];
61+
self.PEID = [decoder decodeObjectForKey:NSStringFromSelector(@selector(PEID))];
62+
self.segmentation = [decoder decodeObjectForKey:NSStringFromSelector(@selector(segmentation))];
63+
self.count = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(count))];
64+
self.sum = [decoder decodeDoubleForKey:NSStringFromSelector(@selector(sum))];
65+
self.timestamp = [decoder decodeDoubleForKey:NSStringFromSelector(@selector(timestamp))];
66+
self.hourOfDay = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(hourOfDay))];
67+
self.dayOfWeek = [decoder decodeIntegerForKey:NSStringFromSelector(@selector(dayOfWeek))];
68+
self.duration = [decoder decodeDoubleForKey:NSStringFromSelector(@selector(duration))];
69+
}
70+
71+
return self;
7272
}
7373

7474
- (void)encodeWithCoder:(NSCoder *)encoder
7575
{
76-
[encoder encodeObject:self.key forKey:NSStringFromSelector(@selector(key))];
77-
[encoder encodeObject:self.ID forKey:NSStringFromSelector(@selector(ID))];
78-
[encoder encodeObject:self.CVID forKey:NSStringFromSelector(@selector(CVID))];
79-
[encoder encodeObject:self.PVID forKey:NSStringFromSelector(@selector(PVID))];
80-
[encoder encodeObject:self.PEID forKey:NSStringFromSelector(@selector(PEID))];
81-
[encoder encodeObject:self.segmentation forKey:NSStringFromSelector(@selector(segmentation))];
82-
[encoder encodeInteger:self.count forKey:NSStringFromSelector(@selector(count))];
83-
[encoder encodeDouble:self.sum forKey:NSStringFromSelector(@selector(sum))];
84-
[encoder encodeDouble:self.timestamp forKey:NSStringFromSelector(@selector(timestamp))];
85-
[encoder encodeInteger:self.hourOfDay forKey:NSStringFromSelector(@selector(hourOfDay))];
86-
[encoder encodeInteger:self.dayOfWeek forKey:NSStringFromSelector(@selector(dayOfWeek))];
87-
[encoder encodeDouble:self.duration forKey:NSStringFromSelector(@selector(duration))];
76+
[encoder encodeObject:self.key forKey:NSStringFromSelector(@selector(key))];
77+
[encoder encodeObject:self.ID forKey:NSStringFromSelector(@selector(ID))];
78+
[encoder encodeObject:self.CVID forKey:NSStringFromSelector(@selector(CVID))];
79+
[encoder encodeObject:self.PVID forKey:NSStringFromSelector(@selector(PVID))];
80+
[encoder encodeObject:self.PEID forKey:NSStringFromSelector(@selector(PEID))];
81+
[encoder encodeObject:self.segmentation forKey:NSStringFromSelector(@selector(segmentation))];
82+
[encoder encodeInteger:self.count forKey:NSStringFromSelector(@selector(count))];
83+
[encoder encodeDouble:self.sum forKey:NSStringFromSelector(@selector(sum))];
84+
[encoder encodeDouble:self.timestamp forKey:NSStringFromSelector(@selector(timestamp))];
85+
[encoder encodeInteger:self.hourOfDay forKey:NSStringFromSelector(@selector(hourOfDay))];
86+
[encoder encodeInteger:self.dayOfWeek forKey:NSStringFromSelector(@selector(dayOfWeek))];
87+
[encoder encodeDouble:self.duration forKey:NSStringFromSelector(@selector(duration))];
8888
}
8989
@end

0 commit comments

Comments
 (0)