iOS SelectionChanged event: pass item + index

This commit is contained in:
adnathan 2016-03-10 15:33:14 -08:00
Родитель 1455a52d8a
Коммит 1098e5dcd5
3 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -165,7 +165,7 @@
NSObject* selection = _Items[indexPath.row];
if (_selectionChangedHandlers > 0) {
[OutgoingMessages raiseEvent:@"selectionchanged" instance:self eventData:selection];
[OutgoingMessages raiseEvent:@"selectionchanged" instance:self eventData:selection eventData2:[NSNumber numberWithInt:indexPath.row]];
}
}

Просмотреть файл

@ -9,6 +9,7 @@
+ (void) setCallbackContext:(NSObject*)callback selector:(SEL)selector;
+ (void) raiseEvent:(NSString*)eventName instance:(NSObject*)instance eventData:(NSObject*) eventData;
+ (void) raiseEvent:(NSString*)eventName instance:(NSObject*)instance eventData:(NSObject*) eventData eventData2:(NSObject*) eventData2;
+ (void) raiseEvent:(NSString*)eventName handle:(AceHandle*)handle eventData:(NSObject*) eventData;
@end

Просмотреть файл

@ -19,8 +19,14 @@ SEL _selector;
+ (void) raiseEvent:(NSString*)eventName instance:(NSObject*)instance eventData:(NSObject*) eventData {
NSArray* array = [NSArray arrayWithObjects:
instance == nil ? nil : [[AceHandle fromObject:instance] toJSON],
eventName,
eventData, nil];
eventName, eventData, nil];
[self send:array];
}
+ (void) raiseEvent:(NSString*)eventName instance:(NSObject*)instance eventData:(NSObject*) eventData eventData2:(NSObject*) eventData2 {
NSArray* array = [NSArray arrayWithObjects:
instance == nil ? nil : [[AceHandle fromObject:instance] toJSON],
eventName, eventData, eventData2, nil];
[self send:array];
}