blob: 28d0ab53aaad58e4124732853c0edbe041da06c5 [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "FWFUIDelegateHostApi.h"
#import "FWFWebViewConfigurationHostApi.h"
@implementation FWFUIDelegate
@end
@interface FWFUIDelegateHostApiImpl ()
@property(nonatomic) FWFInstanceManager *instanceManager;
@end
@implementation FWFUIDelegateHostApiImpl
- (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager {
self = [self init];
if (self) {
_instanceManager = instanceManager;
}
return self;
}
- (FWFUIDelegate *)delegateForIdentifier:(NSNumber *)identifier {
return (FWFUIDelegate *)[self.instanceManager instanceForIdentifier:identifier.longValue];
}
- (void)createWithIdentifier:(nonnull NSNumber *)identifier
error:(FlutterError *_Nullable *_Nonnull)error {
FWFUIDelegate *uIDelegate = [[FWFUIDelegate alloc] init];
[self.instanceManager addDartCreatedInstance:uIDelegate withIdentifier:identifier.longValue];
}
@end