Skip to content

Commit

Permalink
ios support
Browse files Browse the repository at this point in the history
  • Loading branch information
JosLuna98 committed Nov 4, 2020
1 parent ee02414 commit 18acd56
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 0 deletions.
37 changes: 37 additions & 0 deletions ios/.gitignore
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 added ios/Assets/.gitkeep
Empty file.
4 changes: 4 additions & 0 deletions ios/Classes/AddressSearchFieldPlugin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#import <Flutter/Flutter.h>

@interface AddressSearchFieldPlugin : NSObject<FlutterPlugin>
@end
15 changes: 15 additions & 0 deletions ios/Classes/AddressSearchFieldPlugin.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#import "AddressSearchFieldPlugin.h"
#if __has_include(<address_search_field/address_search_field-Swift.h>)
#import <address_search_field/address_search_field-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 "address_search_field-Swift.h"
#endif

@implementation AddressSearchFieldPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
[SwiftAddressSearchFieldPlugin registerWithRegistrar:registrar];
}
@end
14 changes: 14 additions & 0 deletions ios/Classes/SwiftAddressSearchFieldPlugin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Flutter
import UIKit

public class SwiftAddressSearchFieldPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "address_search_field", binaryMessenger: registrar.messenger())
let instance = SwiftAddressSearchFieldPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}

public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
result("iOS " + UIDevice.current.systemVersion)
}
}
23 changes: 23 additions & 0 deletions ios/address_search_field.podspec
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 address_search_field.podspec' to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'address_search_field'
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.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
s.swift_version = '5.0'
end

0 comments on commit 18acd56

Please sign in to comment.