rename initWithFlutterView to initWithController (#9208)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
{{#withPluginHook}}
|
||||
FlutterViewController *flutterController =
|
||||
(FlutterViewController *)self.window.rootViewController;
|
||||
_{{pluginProjectName}} = [[{{pluginClass}} alloc] initWithFlutterView:flutterController];
|
||||
_{{pluginProjectName}} = [[{{pluginClass}} alloc] initWithController:flutterController];
|
||||
{{/withPluginHook}}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#import <Flutter/Flutter.h>
|
||||
|
||||
@interface {{pluginClass}} : NSObject
|
||||
- initWithFlutterView:(FlutterViewController *)flutterView;
|
||||
- initWithController:(FlutterViewController *)controller;
|
||||
@end
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
@implementation {{pluginClass}} {
|
||||
}
|
||||
|
||||
- (instancetype)initWithFlutterView:(FlutterViewController *)flutterView {
|
||||
- (instancetype)initWithController:(FlutterViewController *)controller {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
FlutterMethodChannel *channel = [FlutterMethodChannel
|
||||
methodChannelWithName:@"{{projectName}}"
|
||||
binaryMessenger:flutterView];
|
||||
binaryMessenger:controller];
|
||||
[channel setMethodCallHandler:^(FlutterMethodCall *call,
|
||||
FlutterResultReceiver result) {
|
||||
if ([@"getPlatformVersion" isEqualToString:call.method]) {
|
||||
|
||||
Reference in New Issue
Block a user