David PHAM-VAN

Simplify iOS code

# Changelog
## 2.2.0
- Simplify iOS code
## 2.1.9
- Add Markdown example
... ...
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Flutter/Flutter.h>
@interface PrintingPlugin : NSObject <FlutterPlugin>
@end
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "PrintingPlugin.h"
#import <printing/printing-Swift.h>
@implementation PrintingPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
[SwiftPrintingPlugin registerWithRegistrar:registrar];
}
@end
... ... @@ -18,7 +18,7 @@ import Flutter
import UIKit
import WebKit
public class SwiftPrintingPlugin: NSObject, FlutterPlugin, UIPrintInteractionControllerDelegate {
public class PrintingPlugin: NSObject, FlutterPlugin, UIPrintInteractionControllerDelegate {
private var channel: FlutterMethodChannel?
private var renderer: PdfPrintPageRenderer?
private var urlObservation: NSKeyValueObservation?
... ... @@ -31,7 +31,7 @@ public class SwiftPrintingPlugin: NSObject, FlutterPlugin, UIPrintInteractionCon
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "net.nfet.printing", binaryMessenger: registrar.messenger())
let instance = SwiftPrintingPlugin(channel)
let instance = PrintingPlugin(channel)
registrar.addMethodCallDelegate(instance, channel: channel)
}
... ...
... ... @@ -8,12 +8,11 @@ Pod::Spec.new do |s|
s.description = <<-DESC
Plugin that allows Flutter apps to generate and print documents to android or ios compatible printers
DESC
s.homepage = 'http://example.com'
s.homepage = 'https://github.com/DavBfr/dart_pdf/tree/master/printing'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.author = { 'David PHAM-VAN' => 'dev.nfet.net@gmail.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.ios.deployment_target = '8.0'
... ...