becvert / cordova-plugin-zeroconf

Cordova ZeroConf Plugin
MIT License
81 stars 57 forks source link

xcode 8/ios10 and swift version #13

Closed satish-nikam closed 7 years ago

satish-nikam commented 7 years ago

The plugin does not compile with xcode 8/ios10. We need to convert the swift version.

becvert commented 7 years ago

@satish-nikam we will update the plugin shortly. today or this weekend hopefully.

satish-nikam commented 7 years ago

great. Thanks.

becvert commented 7 years ago

Please let me know if any error occurs

satish-nikam commented 7 years ago

Thank for quickly fixing this. But cordova build is not working out of box and I need to open xcode project to compile it. It asks to convert to current swift version and when doing so, it says "No source changes necessary. Click update to change your target's build settings to use the latest swift syntax".

May be I need to change my cordova project settings for iOS 10.

becvert commented 7 years ago

I think that's normal. Just click to upgrade your target.

emcniece commented 7 years ago

I'm tackling this problem from the Ionic Framework arena. XCode builds are issued via CLI and the project.pbxproj file is generated by script somewhere during the npm install process.

https://github.com/driftyco/ionic-native/issues/620

Adding a SWIFT_VERSION = 2.3 lines to the project.pbxproj file will get XCode to compile the app, but there are many compilation errors that arise:

ionic build ios

Running 'build:before' npm script before build
> ionic-hello-world@ build /Users/emcniece/Code/ionic/my-app
> ionic-app-scripts build --dev
[18:45:40]  ionic-app-scripts 0.0.23
[18:45:40]  build dev started ...
[18:45:40]  clean started ...
[18:45:40]  clean finished in 10 ms
[18:45:40]  copy started ...
[18:45:40]  typescript compiler started ...
[18:45:40]  lint started ...
[18:45:40]  copy finished in 50 ms
[18:45:40]  tslint: /Users/emcniece/Code/ionic/my-app/src/providers/diagnostic/diagnostic.ts[4, 10]: Unused import: 'Diagnostic'

[18:45:40]  lint finished in 588 ms
[18:45:42]  typescript compiler finished in 2.32 s
[18:45:42]  bundle dev started ...
[18:45:48]  bundle dev finished in 6.16 s
[18:45:48]  sass started ...
[18:45:49]  sass finished in 1.08 s
[18:45:49]  build dev finished in 9.57 s
Running command: /Users/emcniece/Code/ionic/my-app/hooks/after_prepare/010_add_platform_class.js /Users/emcniece/Code/ionic/my-app

add to body class: platform-ios

Building project: /Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp.xcodeproj

  Configuration: Debug

  Platform: emulator

Build settings from command line:

    CONFIGURATION_BUILD_DIR = /Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator
    SDKROOT = iphonesimulator10.0
    SHARED_PRECOMPS_DIR = /Users/emcniece/Code/ionic/my-app/platforms/ios/build/sharedpch

Build settings from configuration file '/Users/emcniece/Code/ionic/my-app/platforms/ios/cordova/build-debug.xcconfig':
    CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
    CODE_SIGN_IDENTITY = iPhone Developer
    ENABLE_BITCODE = NO
    GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
    HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
    IPHONEOS_DEPLOYMENT_TARGET = 8.0
    OTHER_LDFLAGS = -ObjC
    SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
    TARGETED_DEVICE_FAMILY = 1,2

=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===

Check dependencies

=== BUILD TARGET MyApp OF PROJECT MyApp WITH CONFIGURATION Debug ===

Check dependencies

warning: no rule to process file '/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-is-debug/IsDebug.h' of type sourcecode.c.h for architecture i386

PhaseScriptExecution Copy\ www\ directory build/MyApp.build/Debug-iphonesimulator/MyApp.build/Script-304B58A110DAC018002A0835.sh
    cd /Users/emcniece/Code/ionic/my-app/platforms/ios
    /bin/sh -c /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Script-304B58A110DAC018002A0835.sh

ProcessInfoPlistFile build/emulator/MyApp.app/Info.plist MyApp/MyApp-Info.plist
    cd /Users/emcniece/Code/ionic/my-app/platforms/ios
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/emcniece/.nvm/versions/node/v6.7.0/bin:/Users/emcniece/.rvm/gems/ruby-2.2.1/bin:/Users/emcniece/.rvm/gems/ruby-2.2.1@global/bin:/Users/emcniece/.rvm/rubies/ruby-2.2.1/bin:/Users/emcniece/.node/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Users/emcniece/.rvm/bin:/usr/X11R6/bin:/usr/local/mongodb/bin:/usr/local/Cellar/android-sdk/24.4.1_1/tools:/usr/local/Cellar/android-sdk/24.4.1_1/platform-tools:"
    builtin-infoPlistUtility /Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/MyApp-Info.plist -genpkginfo /Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator/MyApp.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -additionalcontentfile /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MainViewController-PartialInfo.plist -additionalcontentfile /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/assetcatalog_generated_info.plist -o /Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator/MyApp.app/Info.plist

CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler
    cd /Users/emcniece/Code/ionic/my-app/platforms/ios
    export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/emcniece/.nvm/versions/node/v6.7.0/bin:/Users/emcniece/.rvm/gems/ruby-2.2.1/bin:/Users/emcniece/.rvm/gems/ruby-2.2.1@global/bin:/Users/emcniece/.rvm/rubies/ruby-2.2.1/bin:/Users/emcniece/.node/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Users/emcniece/.rvm/bin:/usr/X11R6/bin:/usr/local/mongodb/bin:/usr/local/Cellar/android-sdk/24.4.1_1/tools:/usr/local/Cellar/android-sdk/24.4.1_1/platform-tools:"
    export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk
    export TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3
    /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin/swiftc -incremental -module-name MyApp -O -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk -target i386-apple-ios8.0 -g -Xfrontend -serialize-debugging-options -I /Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator -F /Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator -parse-as-library -c -j8 /Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift -output-file-map /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.swiftmodule -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-generated-files.hmap -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-own-target-headers.hmap -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-all-target-headers.hmap -Xcc -iquote -Xcc /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-project-headers.hmap -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator/include -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator/usr/local/lib/include -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/UninstalledProducts/include -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/UninstalledProducts/iphonesimulator/include -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources/i386 -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp-Swift.h -import-objc-header /Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Bridging-Header.h -Xcc -working-directory/Users/emcniece/Code/ionic/my-app/platforms/ios

CompileSwift normal i386 /Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift
    cd /Users/emcniece/Code/ionic/my-app/platforms/ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift -target i386-apple-ios8.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk -I /Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator -F /Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator -g -import-objc-header /Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Bridging-Header.h -serialize-debugging-options -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-generated-files.hmap -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-own-target-headers.hmap -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-all-target-headers.hmap -Xcc -iquote -Xcc /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-project-headers.hmap -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator/include -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator/usr/local/lib/include -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/UninstalledProducts/include -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/UninstalledProducts/iphonesimulator/include -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources/i386 -Xcc -I/Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/emcniece/Code/ionic/my-app/platforms/ios -emit-module-doc-path /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/ZeroConf~partial.swiftdoc -O -parse-as-library -module-name MyApp -emit-module-path /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/ZeroConf~partial.swiftmodule -serialize-diagnostics-path /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/ZeroConf.dia -emit-dependencies-path /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/ZeroConf.d -emit-reference-dependencies-path /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/ZeroConf.swiftdeps -o /Users/emcniece/Code/ionic/my-app/platforms/ios/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/ZeroConf.o

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:12:5: error: expected declaration
    fileprivate var publishers: [String: Publisher]!
    ^
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:12:16: error: consecutive declarations on a line must be separated by ';'
    fileprivate var publishers: [String: Publisher]!
               ^
               ;
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:13:5: error: expected declaration
    fileprivate var browsers: [String: Browser]!
    ^
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:13:16: error: consecutive declarations on a line must be separated by ';'
    fileprivate var browsers: [String: Browser]!
               ^
               ;
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:32:26: warning: extraneous '_' in parameter: 'command' has no keyword argument name
    public func register(_ command: CDVInvokedUrlCommand) {
                         ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:59:28: warning: extraneous '_' in parameter: 'command' has no keyword argument name
    public func unregister(_ command: CDVInvokedUrlCommand) {
                           ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:75:22: warning: extraneous '_' in parameter: 'command' has no keyword argument name
    public func stop(_ command: CDVInvokedUrlCommand) {
                     ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:86:23: warning: extraneous '_' in parameter: 'command' has no keyword argument name
    public func watch(_ command: CDVInvokedUrlCommand) {
                      ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:104:25: warning: extraneous '_' in parameter: 'command' has no keyword argument name
    public func unwatch(_ command: CDVInvokedUrlCommand) {
                        ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:119:23: warning: extraneous '_' in parameter: 'command' has no keyword argument name
    public func close(_ command: CDVInvokedUrlCommand) {
                      ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:130:5: error: expected declaration
    fileprivate class Publisher {
    ^
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:130:16: error: consecutive declarations on a line must be separated by ';'
    fileprivate class Publisher {
               ^
               ;
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:187:5: error: expected declaration
    fileprivate class Browser: NSObject, NetServiceDelegate, NetServiceBrowserDelegate {
    ^
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:187:16: error: consecutive declarations on a line must be separated by ';'
    fileprivate class Browser: NSObject, NetServiceDelegate, NetServiceBrowserDelegate {
               ^
               ;
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:247:38: warning: extraneous '_' in parameter: 'netServiceBrowser' has no keyword argument name
        @objc func netServiceBrowser(_ netServiceBrowser: NetServiceBrowser,
                                     ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:258:38: warning: extraneous '_' in parameter: 'netServiceBrowser' has no keyword argument name
        @objc func netServiceBrowser(_ netServiceBrowser: NetServiceBrowser,
                                     ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:274:48: warning: extraneous '_' in parameter: 'netService' has no keyword argument name
        @objc func netServiceDidResolveAddress(_ netService: NetService) {
                                               ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:287:9: error: expected declaration
        fileprivate func jsonifyService(_ netService: NetService) -> NSDictionary {
        ^
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:287:20: error: consecutive declarations on a line must be separated by ';'
        fileprivate func jsonifyService(_ netService: NetService) -> NSDictionary {
                   ^
                   ;
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:287:41: warning: extraneous '_' in parameter: 'netService' has no keyword argument name
        fileprivate func jsonifyService(_ netService: NetService) -> NSDictionary {
                                        ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:305:9: error: expected declaration
        fileprivate func IP(_ addresses: [Data]?) -> [String] {
        ^
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:305:20: error: consecutive declarations on a line must be separated by ';'
        fileprivate func IP(_ addresses: [Data]?) -> [String] {
                   ^
                   ;
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:305:29: warning: extraneous '_' in parameter: 'addresses' has no keyword argument name
        fileprivate func IP(_ addresses: [Data]?) -> [String] {
                            ^~

/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:187:42: error: use of undeclared type 'NetServiceDelegate'
    fileprivate class Browser: NSObject, NetServiceDelegate, NetServiceBrowserDelegate {
                                         ^~~~~~~~~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:187:62: error: use of undeclared type 'NetServiceBrowserDelegate'
    fileprivate class Browser: NSObject, NetServiceDelegate, NetServiceBrowserDelegate {
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:132:19: error: use of undeclared type 'NetService'
        var nsns: NetService?
                  ^~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:137:33: error: use of undeclared type 'Data'
        var txtRecord: [String: Data] = [:]
                                ^~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:140:142: error: use of undeclared type 'Data'
        init (withDomain domain: String, withType type: String, withName name: String, withPort port: Int, withTxtRecord txtRecord: [String: Data]) {
                                                                                                                                             ^~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:189:18: error: use of undeclared
type 'NetServiceBrowser'
        var nsb: NetServiceBrowser?
                 ^~~~~~~~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:193:32: error: use of undeclared type 'NetService'
        var services: [String: NetService] = [:]
                               ^~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:247:59: error: use of undeclared type 'NetServiceBrowser'
        @objc func netServiceBrowser(_ netServiceBrowser: NetServiceBrowser,
                                                          ^~~~~~~~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:248:33: error: use of undeclared type 'NetService'
            didFind netService: NetService,
                                ^~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:258:59: error: use of undeclared type 'NetServiceBrowser'
        @objc func netServiceBrowser(_ netServiceBrowser: NetServiceBrowser,
                                                          ^~~~~~~~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:259:35: error: use of undeclared type 'NetService'
            didRemove netService: NetService,
                                  ^~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:274:62: error: use of undeclared type 'NetService'
        @objc func netServiceDidResolveAddress(_ netService: NetService) {
                                                             ^~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:287:55: error: use of undeclared type 'NetService'
        fileprivate func jsonifyService(_ netService: NetService) -> NSDictionary {
                                                      ^~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:305:43: error: use of undeclared type 'Data'
        fileprivate func IP(_ addresses: [Data]?) -> [String] {
                                          ^~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:34:24: error: value of type 'CDVInvokedUrlCommand' has no member 'argument'
        let fullType = command.argument(at: 0) as! String
                       ^~~~~~~ ~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:38:20: error: value of type 'CDVInvokedUrlCommand' has no member 'argument'
        let name = command.argument(at: 1) as! String
                   ^~~~~~~ ~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:39:20: error: value of type 'CDVInvokedUrlCommand' has no member 'argument'
        let port = command.argument(at: 2) as! Int
                   ^~~~~~~ ~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:45:33: error: use of undeclared type 'Data'
        var txtRecord: [String: Data] = [:]
                                ^~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:61:24: error: value of type 'CDVInvokedUrlCommand' has no member 'argument'
        let fullType = command.argument(at: 0) as! String
                       ^~~~~~~ ~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:62:20: error: value of type 'CDVInvokedUrlCommand' has no member 'argument'
        let name = command.argument(at: 1) as! String
                   ^~~~~~~ ~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:88:24: error: value of type 'CDVInvokedUrlCommand' has no member 'argument'
        let fullType = command.argument(at: 0) as! String
                       ^~~~~~~ ~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:106:24: error: value of type 'CDVInvokedUrlCommand' has no member 'argument'
        let fullType = command.argument(at: 0) as! String
                       ^~~~~~~ ~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:151:27: error: use of unresolved identifier 'NetService'
            let service = NetService(domain: domain, type: type , name: name, port: Int32(port))
                          ^~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:153:34: error: use of unresolved identifier 'NetService'
            service.setTXTRecord(NetService.data(fromTXTRecord: txtRecord))
                                 ^~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:205:27: error: use of unresolved identifier 'NetServiceBrowser'
            let browser = NetServiceBrowser()
                          ^~~~~~~~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:214:25: error: value of type 'CDVPluginResult' has no member 'setKeepCallbackAs'
            pluginResult?.setKeepCallbackAs(true)
            ~~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:232:25: error: value of type 'CDVPluginResult' has no member 'setKeepCallbackAs'
            pluginResult?.setKeepCallbackAs(false)
            ~~~~~~~~~~~~^ ~~~~~~~~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:269:105: error: use of undeclared type 'AnyHashable'
                let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: message as! [AnyHashable: Any])
                                                                                                        ^~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:282:101: error: use of undeclared type 'AnyHashable'
            let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: message as! [AnyHashable: Any])
                                                                                                    ^~~~~~~~~~~
/Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift:292:24: error: use of unresolved identifier 'NetService'
            let dict = NetService.dictionary(fromTXTRecord: netService.txtRecordData()!)
                       ^~~~~~~~~~

** BUILD FAILED **

The following build commands failed:
  CompileSwift normal i386 /Users/emcniece/Code/ionic/my-app/platforms/ios/MyApp/Plugins/cordova-plugin-zeroconf/ZeroConf.swift
  CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler

(2 failures)

Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/emcniece/Code/ionic/my-app/platforms/ios/cordova/build-debug.xcconfig,-project,MyApp.xcodeproj,-target,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,build,CONFIGURATION_BUILD_DIR=/Users/emcniece/Code/ionic/my-app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/emcniece/Code/ionic/my-app/platforms/ios/build/sharedpch
emcniece commented 7 years ago

Ah, yes - we're not on Swift 2.3 anymore, are we?

This compiles fine in Swift 3. Thank you for your work!