RCTComponentViewFactory.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <UIKit/UIKit.h>
  8. #import <React/RCTComponentViewDescriptor.h>
  9. #import <React/RCTComponentViewProtocol.h>
  10. #import <react/uimanager/ComponentDescriptorRegistry.h>
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. * Registry of supported component view classes that can instantiate
  14. * view component instances by given component handle.
  15. */
  16. @interface RCTComponentViewFactory : NSObject
  17. /**
  18. * Constructs and returns an instance of the class with a bunch of already registered standard components.
  19. */
  20. + (RCTComponentViewFactory *)standardComponentViewFactory;
  21. /**
  22. * Registers a component view class in the factory.
  23. */
  24. - (void)registerComponentViewClass:(Class<RCTComponentViewProtocol>)componentViewClass;
  25. /**
  26. * Creates a component view with given component handle.
  27. */
  28. - (RCTComponentViewDescriptor)createComponentViewWithComponentHandle:(facebook::react::ComponentHandle)componentHandle;
  29. /**
  30. * Creates *managed* `ComponentDescriptorRegistry`. After creation, the object continues to store a weak pointer to the
  31. * registry and update it accordingly to the changes in the object.
  32. */
  33. - (facebook::react::ComponentDescriptorRegistry::Shared)createComponentDescriptorRegistryWithParameters:
  34. (facebook::react::ComponentDescriptorParameters)parameters;
  35. @end
  36. NS_ASSUME_NONNULL_END