-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add iOS boilerplate to keep pub publish happy
Despite being an Android-only plugin, pub publish has taken it upon itself to reject any apps that do not include boilerplate iOS scaffolding, regardless of whether iOS is supported or not. This is supposed to be 'fixed' in the upcoming 1.20.0 release, but it makes little sense to constrain the plugin to a release that hasn't even happened yet. Rip this back out once Flutter behaves the way it should have from the beginning.
- Loading branch information
Showing
6 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.idea/ | ||
.vagrant/ | ||
.sconsign.dblite | ||
.svn/ | ||
|
||
.DS_Store | ||
*.swp | ||
profile | ||
|
||
DerivedData/ | ||
build/ | ||
GeneratedPluginRegistrant.h | ||
GeneratedPluginRegistrant.m | ||
|
||
.generated/ | ||
|
||
*.pbxuser | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.perspectivev3 | ||
|
||
!default.pbxuser | ||
!default.mode1v3 | ||
!default.mode2v3 | ||
!default.perspectivev3 | ||
|
||
xcuserdata | ||
|
||
*.moved-aside | ||
|
||
*.pyc | ||
*sync/ | ||
Icon? | ||
.tags* | ||
|
||
/Flutter/Generated.xcconfig | ||
/Flutter/flutter_export_environment.sh |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#import <Flutter/Flutter.h> | ||
|
||
@interface FlutterWindowmanagerPlugin : NSObject<FlutterPlugin> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#import "FlutterWindowmanagerPlugin.h" | ||
#if __has_include(<flutter_windowmanager/flutter_windowmanager-Swift.h>) | ||
#import <flutter_windowmanager/flutter_windowmanager-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 "flutter_windowmanager-Swift.h" | ||
#endif | ||
|
||
@implementation FlutterWindowmanagerPlugin | ||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { | ||
[SwiftFlutterWindowmanagerPlugin registerWithRegistrar:registrar]; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Flutter | ||
import UIKit | ||
|
||
public class SwiftFlutterWindowmanagerPlugin: NSObject, FlutterPlugin { | ||
public static func register(with registrar: FlutterPluginRegistrar) { | ||
let channel = FlutterMethodChannel(name: "flutter_windowmanager", binaryMessenger: registrar.messenger()) | ||
let instance = SwiftFlutterWindowmanagerPlugin() | ||
registrar.addMethodCallDelegate(instance, channel: channel) | ||
} | ||
|
||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { | ||
result("iOS " + UIDevice.current.systemVersion) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. | ||
# Run `pod lib lint flutter_windowmanager.podspec' to validate before publishing. | ||
# | ||
Pod::Spec.new do |s| | ||
s.name = 'flutter_windowmanager' | ||
s.version = '0.0.1' | ||
s.summary = 'A new flutter plugin project.' | ||
s.description = <<-DESC | ||
A new flutter plugin project. | ||
DESC | ||
s.homepage = 'http://example.com' | ||
s.license = { :file => '../LICENSE' } | ||
s.author = { 'Your Company' => '[email protected]' } | ||
s.source = { :path => '.' } | ||
s.source_files = 'Classes/**/*' | ||
s.dependency 'Flutter' | ||
s.platform = :ios, '8.0' | ||
|
||
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. | ||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } | ||
s.swift_version = '5.0' | ||
end |