David PHAM-VAN

Simplify iOS code

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