Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
2017-06-22 09:57:03.566 Titanium[2093:81462] [INFO] 1 OK
2017-06-22 09:57:07.588 Titanium[2093:81462] [INFO] 2 OK - b
2017-06-22 09:57:15.519 Titanium[2093:81462] [INFO] 3 OK
2017-06-22 09:57:16.969 Titanium[2093:81462] [INFO] 4 OK - b
2017-06-22 09:57:19.108 Titanium[2093:81462] [INFO] 5 OK
2017-06-22 09:57:20.003 Titanium[2093:81462] [INFO] 6 OK - b
2017-06-22 09:57:21.285 Titanium[2093:81462] [INFO] 7 OK
2017-06-22 09:57:22.265 Titanium[2093:81462] [INFO] 8 OK - b
2017-06-22 09:57:23.820 Titanium[2093:81462] [INFO] 9 OK
2017-06-22 09:57:24.843 Titanium[2093:81462] [INFO] 10 OK - b
2017-06-22 09:57:27.442 Titanium[2093:81462] [INFO] 11 OK
2017-06-22 09:57:28.960 Titanium[2093:81462] [INFO] 12 OK - b
2017-06-22 09:57:30.937 Titanium[2093:81462] [INFO] 13 OK
2017-06-22 09:57:32.371 Titanium[2093:81462] [INFO] 14 OK - b
2017-06-22 09:57:33.662 Titanium[2093:81462] [INFO] 15 OK
2017-06-22 09:57:34.907 Titanium[2093:81462] [INFO] 16 OK - b
2017-06-22 09:57:36.035 Titanium[2093:81462] [INFO] 17 OK
2017-06-22 09:57:37.059 Titanium[2093:81462] [INFO] 18 OK - b
2017-06-22 09:57:38.344 Titanium[2093:81462] [INFO] 19 OK
2017-06-22 09:57:39.609 Titanium[2093:81462] [INFO] 20 OK - b
2017-06-22 09:57:40.795 Titanium[2093:81462] [INFO] 21 OK
2017-06-22 09:57:42.048 Titanium[2093:81462] [INFO] 22 OK - b
2017-06-22 09:57:43.194 Titanium[2093:81462] [INFO] 23 OK
2017-06-22 09:57:44.169 Titanium[2093:81462] [INFO] 24 OK - b
2017-06-22 09:57:45.342 Titanium[2093:81462] [INFO] 25 OK
2017-06-22 09:57:46.493 Titanium[2093:81462] [INFO] 26 OK - b
2017-06-22 09:57:47.784 Titanium[2093:81462] [INFO] 27 OK
2017-06-22 09:57:48.825 Titanium[2093:81462] [INFO] 28 OK - b
2017-06-22 09:57:49.935 Titanium[2093:81462] [INFO] 29 OK
2017-06-22 09:57:51.008 Titanium[2093:81462] [INFO] 30 OK - b
2017-06-22 09:57:52.124 Titanium[2093:81462] [INFO] 31 OK
2017-06-22 09:57:53.194 Titanium[2093:81462] [INFO] 32 OK - b
2017-06-22 09:57:54.285 Titanium[2093:81462] [INFO] 33 OK
2017-06-22 09:57:55.957 Titanium[2093:81462] [INFO] 34 OK - b
2017-06-22 09:57:57.537 Titanium[2093:81462] [INFO] 35 OK
2017-06-22 09:57:58.763 Titanium[2093:81462] [INFO] 36 OK - b
2017-06-22 09:57:59.936 Titanium[2093:81462] [INFO] 37 OK
2017-06-22 09:58:01.145 Titanium[2093:81462] [INFO] 38 OK - b
2017-06-22 09:58:02.580 Titanium[2093:81462] [INFO] 39 OK
2017-06-22 09:58:03.516 Titanium[2093:81462] [INFO] 40 OK - b
2017-06-22 09:58:05.759 Titanium[2093:81462] [INFO] 41 OK
2017-06-22 09:58:07.032 Titanium[2093:81462] [INFO] 42 OK - b
2017-06-22 09:58:08.335 Titanium[2093:81462] [INFO] 43 OK
2017-06-22 09:58:09.456 Titanium[2093:81462] [INFO] 44 OK - b
2017-06-22 09:58:10.545 Titanium[2093:81462] [INFO] 45 Cancel.
2017-06-22 09:58:12.257 Titanium[2093:81462] [INFO] 46 OK
2017-06-22 09:58:13.911 Titanium[2093:81462] [INFO] 47 OK - b
2017-06-22 09:58:14.965 Titanium[2093:81462] [INFO] 48 OK
2017-06-22 09:58:16.218 Titanium[2093:81462] [INFO] 49 OK - b
2017-06-22 09:58:18.895 Titanium[2093:81462] [INFO] 50 OK
2017-06-22 09:58:19.984 Titanium[2093:81462] [INFO] 51 OK - b
2017-06-22 09:58:21.172 Titanium[2093:81462] [INFO] 52 OK
2017-06-22 09:58:22.317 Titanium[2093:81462] [INFO] 53 OK - b
2017-06-22 09:58:23.461 Titanium[2093:81462] [INFO] 54 OK
2017-06-22 09:58:24.666 Titanium[2093:81462] [INFO] 55 OK - b
2017-06-22 09:58:26.021 Titanium[2093:81462] [INFO] 56 OK
2017-06-22 09:58:27.133 Titanium[2093:81462] [INFO] 57 OK - b
2017-06-22 09:58:28.214 Titanium[2093:81462] [INFO] 58 OK
2017-06-22 09:58:29.427 Titanium[2093:81462] [INFO] 59 OK - b
2017-06-22 09:58:31.207 Titanium[2093:81462] [INFO] 60 OK
2017-06-22 09:58:32.257 Titanium[2093:81462] [INFO] 61 OK - b
2017-06-22 09:58:37.481 Titanium[2093:81462] [INFO] 62 OK
2017-06-22 09:58:38.433 Titanium[2093:81462] [INFO] 63 OK - b
2017-06-22 09:58:39.746 Titanium[2093:81462] [INFO] 64 OK
2017-06-22 09:58:40.767 Titanium[2093:81462] [INFO] 65 OK - b
2017-06-22 09:58:42.248 Titanium[2093:81462] [INFO] 66 OK
2017-06-22 09:58:43.304 Titanium[2093:81462] [INFO] 67 OK - b
2017-06-22 09:58:44.465 Titanium[2093:81462] [INFO] 68 OK
2017-06-22 09:58:45.400 Titanium[2093:81462] [INFO] 69 OK - b
2017-06-22 09:58:47.049 Titanium[2093:81462] [INFO] 70 OK
2017-06-22 09:58:48.104 Titanium[2093:81462] [INFO] 71 OK - b
2017-06-22 09:58:49.312 Titanium[2093:81462] [INFO] 72 OK
2017-06-22 09:58:50.268 Titanium[2093:81462] [INFO] 73 OK - b
2017-06-22 09:58:51.358 Titanium[2093:81462] [INFO] 74 OK
2017-06-22 09:58:52.551 Titanium[2093:81462] [INFO] 75 OK - b
2017-06-22 09:58:53.685 Titanium[2093:81462] [INFO] 76 OK
2017-06-22 09:58:54.842 Titanium[2093:81462] [INFO] 77 OK - b
2017-06-22 09:58:56.148 Titanium[2093:81462] [INFO] 78 OK
2017-06-22 09:58:57.408 Titanium[2093:81462] [INFO] 79 OK - b
2017-06-22 09:58:58.756 Titanium[2093:81462] [INFO] 80 OK
2017-06-22 09:58:59.707 Titanium[2093:81462] [INFO] 81 OK - b
- (void)fireClickEventWithAction:(UIAlertAction*)theAction
{
if ([self _hasListeners:@"click"]) {
NSUInteger indexOfAction = [[alertController actions] indexOfObject:theAction];
NSMutableDictionary *event = [NSMutableDictionary dictionaryWithDictionary:@{
@"index": NUMUINTEGER(indexOfAction),
@"cancel": NUMINTEGER(cancelIndex),
@"destructive": NUMINTEGER(destructiveIndex),
@"preferred": NUMINTEGER(preferredIndex),
}];
if (style == UIAlertViewStylePlainTextInput || style == UIAlertViewStyleSecureTextInput) {
NSString* theText = [[[alertController textFields] objectAtIndex:0] text];
[event setObject:(IS_NULL_OR_NIL(theText) ? @"" : theText) forKey:@"text"];
} else if (style == UIAlertViewStyleLoginAndPasswordInput) {
NSArray* textFields = [alertController textFields];
for (UITextField* theField in textFields) {
NSString* theText = [theField text];
[event setObject:(IS_NULL_OR_NIL(theText) ? @"" : theText) forKey:([theField isSecureTextEntry] ? @"password" : @"login")];
}
}
dispatch_queue_t eventQueue = dispatch_queue_create("com.appcelerator.alert-queue", DISPATCH_QUEUE_SERIAL);
dispatch_sync(eventQueue, ^{
[self fireEvent:@"click" withObject:event];
});
}
[self cleanup];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment