diff --git a/React/Executors/RCTJSCExecutor.m b/React/Executors/RCTJSCExecutor.m index de36fe72c3c38f..8c12fdd5409f75 100644 --- a/React/Executors/RCTJSCExecutor.m +++ b/React/Executors/RCTJSCExecutor.m @@ -718,9 +718,6 @@ - (NSData *)loadRAMBundle:(NSData *)script // offset where the code starts on the bundle const uint32_t baseOffset = currentOffset + tableLength; - // skip table length - currentOffset += sizeof(baseOffset); - // pointer to first byte out of the index const uint8_t *endOfTable = bytes + baseOffset; diff --git a/React/Modules/RCTAlertManager.m b/React/Modules/RCTAlertManager.m index 7ab8f49e71b263..0d655733530dcb 100644 --- a/React/Modules/RCTAlertManager.m +++ b/React/Modules/RCTAlertManager.m @@ -75,6 +75,7 @@ - (void)invalidate NSString *message = [RCTConvert NSString:args[@"message"]]; UIAlertViewStyle type = [RCTConvert UIAlertViewStyle:args[@"type"]]; NSArray *buttons = [RCTConvert NSDictionaryArray:args[@"buttons"]]; + NSString *defaultValue = [RCTConvert NSString:args[@"defaultValue"]]; NSString *cancelButtonKey = [RCTConvert NSString:args[@"cancelButtonKey"]]; NSString *destructiveButtonKey = [RCTConvert NSString:args[@"destructiveButtonKey"]]; @@ -112,7 +113,6 @@ - (void)invalidate alertView.message = message; if (type != UIAlertViewStyleDefault) { - NSString *defaultValue = [RCTConvert NSString:args[@"defaultValue"]]; [alertView textFieldAtIndex:0].text = defaultValue; } @@ -168,25 +168,32 @@ - (void)invalidate message:nil preferredStyle:UIAlertControllerStyleAlert]; switch (type) { - case UIAlertViewStylePlainTextInput: + case UIAlertViewStylePlainTextInput: { [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { textField.secureTextEntry = NO; + textField.text = defaultValue; }]; break; - case UIAlertViewStyleSecureTextInput: + } + case UIAlertViewStyleSecureTextInput: { [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { textField.placeholder = RCTUIKitLocalizedString(@"Password"); textField.secureTextEntry = YES; + textField.text = defaultValue; }]; break; - case UIAlertViewStyleLoginAndPasswordInput: + } + case UIAlertViewStyleLoginAndPasswordInput: { [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { textField.placeholder = RCTUIKitLocalizedString(@"Login"); + textField.text = defaultValue; }]; [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { textField.placeholder = RCTUIKitLocalizedString(@"Password"); textField.secureTextEntry = YES; }]; + break; + } case UIAlertViewStyleDefault: break; }