remove Objective-C code and rename PhotoGalleryPlugin.swift

This commit is contained in:
Wenqi Li 2023-08-14 01:06:39 +08:00
parent 8b2269a125
commit 2887edc455
3 changed files with 2 additions and 21 deletions

View File

@ -1,4 +0,0 @@
#import <Flutter/Flutter.h>
@interface PhotoGalleryPlugin : NSObject<FlutterPlugin>
@end

View File

@ -1,15 +0,0 @@
#import "PhotoGalleryPlugin.h"
#if __has_include(<photo_gallery/photo_gallery-Swift.h>)
#import <photo_gallery/photo_gallery-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 "photo_gallery-Swift.h"
#endif
@implementation PhotoGalleryPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
[SwiftPhotoGalleryPlugin registerWithRegistrar:registrar];
}
@end

View File

@ -4,10 +4,10 @@ import Flutter
import UIKit
import Photos
public class SwiftPhotoGalleryPlugin: NSObject, FlutterPlugin {
public class PhotoGalleryPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "photo_gallery", binaryMessenger: registrar.messenger())
let instance = SwiftPhotoGalleryPlugin()
let instance = PhotoGalleryPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}