amap_map_fluttify/ios/Classes/MACustomCalloutViewFactory.m

79 lines
2.4 KiB
Mathematica
Raw Normal View History

2024-11-17 15:45:43 +08:00
//////////////////////////////////////////////////////////
// GENERATED BY FLUTTIFY. DO NOT EDIT IT.
//////////////////////////////////////////////////////////
#import "MACustomCalloutViewFactory.h"
#import "AmapMapFluttifyPlugin.h"
#import <objc/runtime.h>
#import "FluttifyMessageCodec.h"
// Dart, MethodChannel,
extern NSMutableDictionary<NSString*, NSObject*>* STACK;
// Dart
extern NSMutableDictionary<NSString*, NSObject*>* HEAP;
//
extern BOOL enableLog;
@implementation MACustomCalloutViewFactory {
}
- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar {
self = [super init];
if (self) {
_registrar = registrar;
}
return self;
}
- (NSObject<FlutterMessageCodec>*)createArgsCodec {
return [FlutterStandardMessageCodec codecWithReaderWriter:[[FluttifyReaderWriter alloc] init]];
}
- (NSObject <FlutterPlatformView> *)createWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id _Nullable)args {
return [[MACustomCalloutViewPlatformView alloc] initWithViewId:viewId frame: frame registrar:_registrar arguments: args];
}
@end
@implementation MACustomCalloutViewPlatformView {
int64_t _viewId;
CGRect _frame;
NSDictionary<NSString *, Handler>* _handlerMap;
MACustomCalloutView* _view;
id _args;
}
- (instancetype)initWithViewId:(int64_t)viewId frame:(CGRect)frame registrar:(NSObject <FlutterPluginRegistrar> *)registrar arguments:(id _Nullable)args {
self = [super init];
if (self) {
_viewId = viewId;
_registrar = registrar;
_frame = frame;
_args = args;
}
return self;
}
- (UIView *)view {
__weak __typeof(self)weakSelf = self;
if (_view == nil) {
NSDictionary<NSString*, id>* params = (NSDictionary<NSString*, id>*) _args;
_view = [[MACustomCalloutView alloc] initWithFrame:_frame];
////////////////////////////////UiKitView////////////////////////////////////////
////////////////////////////////UiKitView////////////////////////////////////////
// magic numberid
// viewIdrefId, viewIdrefId使
HEAP[[NSString stringWithFormat:@"%@", @(2147483647 - _viewId)]] = _view;
HEAP[[NSString stringWithFormat:@"%@:%@", @"MACustomCalloutView", @(_view.hash)]] = _view;
}
return _view;
}
@end