| // 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 *)instanceId { |
| return (FWFUIDelegate *)[self.instanceManager instanceForIdentifier:instanceId.longValue]; |
| } |
| |
| - (void)createWithIdentifier:(nonnull NSNumber *)instanceId |
| error:(FlutterError *_Nullable *_Nonnull)error { |
| FWFUIDelegate *uIDelegate = [[FWFUIDelegate alloc] init]; |
| [self.instanceManager addInstance:uIDelegate withIdentifier:instanceId.longValue]; |
| } |
| @end |