react-native-macos/React/Base
Eli White 91681016e8 Add utility methods for enabling high quality error messages
Summary:
These helper functions will be used by the ObjC generated code for support on commands.

This is an example of what that code might look like and how these functions will be used.
```
- (void)handleCommand:(NSString const *)commandName args:(NSArray const *)args
{
  if ([commandName isEqualToString:@"scrollTo"]) {
    if ([args count] != 2) {
      RCTLogError(
          @"%@ command %@ received %d arguments, expected %d.", @"ScrollView", @"scrollTo", (int)[args count], 2);
      return;
    }

    NSObject *arg0 = args[0];
    if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"ScrollView", @"scrollTo", @"1st")) {
      return;
    }

    int x = [(NSNumber *)arg0 intValue];

    NSObject *arg1 = args[1];
    if (!RCTValidateTypeOfViewCommandArgument(arg1, [NSNumber class], @"number", @"ScrollView", @"scrollTo", @"2nd")) {
      return;
    }
    int y = [(NSNumber *)arg1 intValue];

    [self scrollTo:x y:y];
  } else if ([commandName isEqualToString:@"scrollToEnd"]) {
    if ([args count] != 0) {
      RCTLogError(
          @"%@ command %@ received %d arguments, expected %d.", @"ScrollView", @"scrollToEnd", (int)[args count], 0);
      return;
    }

    [self scrollToEnd];
  }
}
```

Reviewed By: JoshuaGross

Differential Revision: D16474117

fbshipit-source-id: 2bb9f01d7c97cc59e9373b7759021c65980fcc0e
2019-07-24 19:39:29 -07:00
..
Surface Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTAssert.h Crash reporting heaven (#23691) 2019-03-12 19:41:51 -07:00
RCTAssert.m Crash reporting heaven (#23691) 2019-03-12 19:41:51 -07:00
RCTBridge+Private.h Remove compiler warning (#23588) 2019-02-22 01:40:09 -08:00
RCTBridge.h Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTBridge.m Initial UIKitForMac support (#25427) 2019-07-04 10:30:33 -07:00
RCTBridgeDelegate.h iOS: register lazy nativemodules on startup when Chrome is attached 2018-11-02 00:16:16 -07:00
RCTBridgeMethod.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTBridgeModule.h Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTBundleURLProvider.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTBundleURLProvider.m Unify "Hot Reloading" and "Reload-on-Save" into "Fast Refresh" 2019-06-24 13:54:39 -07:00
RCTComponentEvent.h Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTComponentEvent.m Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTConvert.h Fix RNTester build 2018-09-17 12:33:01 -07:00
RCTConvert.m Back out "[react-native][PR] [iOS] Add convert compatible of NSString for bridge message data" 2019-06-24 07:13:46 -07:00
RCTCxxConvert.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTCxxConvert.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTDefines.h Fixes iOS packager connection not work (#25803) 2019-07-24 11:18:17 -07:00
RCTDisplayLink.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTDisplayLink.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTErrorCustomizer.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTErrorInfo.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTErrorInfo.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTEventDispatcher.h Fix event ordering when combining coalescable and non-coalescable events (#24693) 2019-05-09 10:36:56 -07:00
RCTEventDispatcher.m Fix event ordering when combining coalescable and non-coalescable events (#24693) 2019-05-09 10:36:56 -07:00
RCTFrameUpdate.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTFrameUpdate.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTImageSource.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTImageSource.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTInvalidating.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTJSStackFrame.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTJSStackFrame.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTJavaScriptExecutor.h iOS changes to switch to JSI 2018-10-18 01:06:24 -07:00
RCTJavaScriptLoader.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTJavaScriptLoader.mm iOS changes to switch to JSI 2018-10-18 01:06:24 -07:00
RCTKeyCommands.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTKeyCommands.m Remove compatible system code for iOS8 and before (#23656) 2019-02-26 07:58:52 -08:00
RCTLog.h Back out OSS-only change from D14811733 and fix regression in open source iOS tests 2019-04-11 12:57:15 -07:00
RCTLog.mm Remove asl_log (Fixes #25380) (#25382) 2019-06-28 01:38:40 -07:00
RCTManagedPointer.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTManagedPointer.mm Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTModuleData.h RN iOS: Support View Manager Commands that are strings 2019-06-26 10:05:33 -07:00
RCTModuleData.mm Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTModuleMethod.h Add support for argument conversion via RCTConvert 2019-03-22 16:23:40 -07:00
RCTModuleMethod.mm Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTMultipartDataTask.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTMultipartDataTask.m Remove compatible system code for iOS8 and before (#23656) 2019-02-26 07:58:52 -08:00
RCTMultipartStreamReader.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTMultipartStreamReader.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTNullability.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTParserUtils.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTParserUtils.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTPerformanceLogger.h - fix crash on performance logger (#24821) 2019-05-18 08:36:15 -07:00
RCTPerformanceLogger.m - fix crash on performance logger (#24821) 2019-05-18 08:36:15 -07:00
RCTReloadCommand.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTReloadCommand.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTRootContentView.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTRootContentView.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTRootView.h Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTRootView.m Deprecation of `-[RCTRootView cancelTouches]` 2019-06-11 07:31:42 -07:00
RCTRootViewDelegate.h Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTRootViewInternal.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTTVRemoteHandler.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTTVRemoteHandler.m Differentiate swipe and tap events (#22916) 2019-01-15 16:29:38 -08:00
RCTTouchEvent.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTTouchEvent.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTTouchHandler.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTTouchHandler.m Fix typos (#25770) 2019-07-23 03:23:11 -07:00
RCTURLRequestDelegate.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTURLRequestHandler.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTUtils.h Add utility methods for enabling high quality error messages 2019-07-24 19:39:29 -07:00
RCTUtils.m Add utility methods for enabling high quality error messages 2019-07-24 19:39:29 -07:00
RCTVersion.h iOS Buck: Create CoreModules sub-target 2019-07-01 15:20:01 -07:00
RCTVersion.m Lazily create RCTVersion dict 2019-07-12 16:51:28 -07:00