Unverified Commit b0842491 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Remove Swift plugin Objective-C files (#113585)

parent eea60f86
#import <Flutter/Flutter.h>
@interface {{pluginClass}} : NSObject<FlutterPlugin>
@end
#import "{{pluginClass}}.h"
#if __has_include(<{{projectName}}/{{projectName}}-Swift.h>)
#import <{{projectName}}/{{projectName}}-Swift.h>
#else
// Support project import fallback if the generated compatibility header
// is not copied when this plugin is created as a library.
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
#import "{{projectName}}-Swift.h"
#endif
@implementation {{pluginClass}}
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
[Swift{{pluginClass}} registerWithRegistrar:registrar];
}
@end
import Flutter
import UIKit
public class Swift{{pluginClass}}: NSObject, FlutterPlugin {
public class {{pluginClass}}: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "{{projectName}}", binaryMessenger: registrar.messenger())
let instance = Swift{{pluginClass}}()
let instance = {{pluginClass}}()
registrar.addMethodCallDelegate(instance, channel: channel)
}
......
......@@ -258,9 +258,7 @@
"templates/plugin/ios-objc.tmpl/Classes/pluginClass.h.tmpl",
"templates/plugin/ios-objc.tmpl/Classes/pluginClass.m.tmpl",
"templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl",
"templates/plugin/ios-swift.tmpl/Classes/pluginClass.h.tmpl",
"templates/plugin/ios-swift.tmpl/Classes/pluginClass.m.tmpl",
"templates/plugin/ios-swift.tmpl/Classes/SwiftpluginClass.swift.tmpl",
"templates/plugin/ios-swift.tmpl/Classes/pluginClass.swift.tmpl",
"templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl",
"templates/plugin/ios.tmpl/.gitignore",
"templates/plugin/ios.tmpl/Assets/.gitkeep",
......
......@@ -638,9 +638,7 @@ void main() {
'example/ios/Runner/AppDelegate.swift',
'example/ios/Runner/Runner-Bridging-Header.h',
'example/lib/main.dart',
'ios/Classes/FlutterProjectPlugin.h',
'ios/Classes/FlutterProjectPlugin.m',
'ios/Classes/SwiftFlutterProjectPlugin.swift',
'ios/Classes/FlutterProjectPlugin.swift',
'lib/flutter_project.dart',
],
unexpectedPaths: <String>[
......@@ -649,6 +647,8 @@ void main() {
'example/ios/Runner/AppDelegate.h',
'example/ios/Runner/AppDelegate.m',
'example/ios/Runner/main.m',
'ios/Classes/FlutterProjectPlugin.h',
'ios/Classes/FlutterProjectPlugin.m',
],
);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment