|
| 1 | +// |
| 2 | +// KeyboardToolbarExcludeViewManager.mm |
| 3 | +// react-native-keyboard-controller |
| 4 | +// |
| 5 | +// Created by Kiryl Ziusko on 26/12/2024. |
| 6 | +// |
| 7 | + |
| 8 | +#import "KeyboardToolbarExcludeViewManager.h" |
| 9 | + |
| 10 | +#ifdef RCT_NEW_ARCH_ENABLED |
| 11 | +#import <react/renderer/components/reactnativekeyboardcontroller/ComponentDescriptors.h> |
| 12 | +#import <react/renderer/components/reactnativekeyboardcontroller/EventEmitters.h> |
| 13 | +#import <react/renderer/components/reactnativekeyboardcontroller/Props.h> |
| 14 | +#import <react/renderer/components/reactnativekeyboardcontroller/RCTComponentViewHelpers.h> |
| 15 | + |
| 16 | +#import "RCTFabricComponentsPlugins.h" |
| 17 | +#endif |
| 18 | + |
| 19 | +#import <UIKit/UIKit.h> |
| 20 | + |
| 21 | +#ifdef RCT_NEW_ARCH_ENABLED |
| 22 | +using namespace facebook::react; |
| 23 | +#endif |
| 24 | + |
| 25 | +// MARK: Manager |
| 26 | +@implementation KeyboardToolbarExcludeViewManager |
| 27 | + |
| 28 | +RCT_EXPORT_MODULE(KeyboardToolbarExcludeViewManager) |
| 29 | + |
| 30 | ++ (BOOL)requiresMainQueueSetup |
| 31 | +{ |
| 32 | + return NO; |
| 33 | +} |
| 34 | + |
| 35 | +#ifndef RCT_NEW_ARCH_ENABLED |
| 36 | +- (UIView *)view |
| 37 | +{ |
| 38 | + return [[KeyboardToolbarExcludeView alloc] initWithBridge:self.bridge]; |
| 39 | +} |
| 40 | +#endif |
| 41 | + |
| 42 | +@end |
| 43 | + |
| 44 | +// MARK: View |
| 45 | +#ifdef RCT_NEW_ARCH_ENABLED |
| 46 | +@interface KeyboardToolbarExcludeView () <RCTKeyboardToolbarExcludeViewViewProtocol> |
| 47 | +@end |
| 48 | +#endif |
| 49 | + |
| 50 | +@implementation KeyboardToolbarExcludeView {} |
| 51 | + |
| 52 | +#ifdef RCT_NEW_ARCH_ENABLED |
| 53 | ++ (ComponentDescriptorProvider)componentDescriptorProvider |
| 54 | +{ |
| 55 | + return concreteComponentDescriptorProvider<KeyboardToolbarExcludeViewComponentDescriptor>(); |
| 56 | +} |
| 57 | +#endif |
| 58 | + |
| 59 | +// Needed because of this: https://github.com/facebook/react-native/pull/37274 |
| 60 | ++ (void)load |
| 61 | +{ |
| 62 | + [super load]; |
| 63 | +} |
| 64 | + |
| 65 | +// MARK: Constructor |
| 66 | +#ifdef RCT_NEW_ARCH_ENABLED |
| 67 | +- (instancetype)init |
| 68 | +{ |
| 69 | + self = [super init]; |
| 70 | + return self; |
| 71 | +} |
| 72 | +#else |
| 73 | +- (instancetype)initWithBridge:(RCTBridge *)bridge |
| 74 | +{ |
| 75 | + self = [super init]; |
| 76 | + return self; |
| 77 | +} |
| 78 | +#endif |
| 79 | + |
| 80 | + |
| 81 | +#ifdef RCT_NEW_ARCH_ENABLED |
| 82 | +Class<RCTComponentViewProtocol> KeyboardToolbarExcludeViewCls(void) |
| 83 | +{ |
| 84 | + return KeyboardToolbarExcludeView.class; |
| 85 | +} |
| 86 | +#endif |
| 87 | + |
| 88 | +@end |
0 commit comments