Latest 0.0.6
Homepage https://github.com/mrmitew/coucou_ios
License MIT
Platforms ios 8.0
Authors

CocoaPods Compatible
Platform

Coucou (iOS)

A highly modular network service discovery and broadcast library for iOS. For Android, go to coucou_android repo.

Coucou API

func startDiscovery(ofType type: String,
                    domain: String,
                    _ onResolved: (DiscoveryEvent) -> Void) -> Disposable

How to use

Creation

let coucou = Coucou.Builder()
        .driver(AppleBonjour())
        .logger(StandardLogger())
        .build()
}

Network Service Discovery

let disposable = coucou.startDiscovery(ofType: "_http._tcp.") { (event) in
  // TODO something with the DiscoveryEvent

  if(event is ServiceResolved) {
    // TODO something with event.service
  } else if (event is ServiceLost) {
    // TODO something with event.service
  } else if (event is DiscoveryFinished) {
    // TODO
  } else if (event is ResolvingFinished) {
    // TODO
  } else if (event is DiscoveryFailure) {
    // TODO
  }
}

// when discovery isn't needed, dispose

disposable.dispose()

DiscoveryService provides the following information:

public struct DiscoveryService {
    let name: String
    let ipaddress: String?
    let port: Int
}

For more insights, please refer to the source code.

Network Service Broadcast

  • Yet to be done.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate Coucou into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'

target 'ENTER_YOUR_TARGET_NAME_HERE' do
    pod 'Coucou', '~> ENTER_COUCOU_VERSION_HERE'
end

Then, run the following command:

$ pod install

Done.

Carthage

Unsupported at the moment.

To do

  • Support for Network Service Broadcast
  • Write unit tests
  • Complete sample
  • More documentation
  • Improve the README

Latest podspec

{
    "name": "Coucou",
    "version": "0.0.6",
    "summary": "A highly modular network service discovery and broadcast library.",
    "description": "A highly modular network service discovery and broadcast library. Note: Still under development.",
    "homepage": "https://github.com/mrmitew/coucou_ios",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Stefan Mitev": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/mrmitew/coucou_ios.git",
        "tag": "0.0.6"
    },
    "source_files": [
        "Coucou/*.swift",
        "Coucou/driver/*",
        "Coucou/driver/impl/*",
        "Coucou/engine/*",
        "Coucou/engine/impl/*",
        "Coucou/internal/*",
        "Coucou/logger/*",
        "Coucou/logger/impl/*",
        "Coucou/models/*"
    ],
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This