Ad

Our DNA is written in Swift
Jump

DTBonjour 1.1.0

DTBonjour is a convenient wrapper that lets you send NSObjects over a Bonjour connection. This is the first version of DTBonjour that has added features over the initial 1.0 release.

Changes

  • FIXED: Various type warnings
  • ADDED: New method on DTBonjourDataConnection which allows specifying a timeout
  • ADDED: Delegate method for when connection was opened
  • ADDED: arm64 support
  • CHANGED: Updated for building with Xcode 5
  • CHANGED: Use original NSNetService method to get connection where workaround no longer necessary

The majority of fixes was contributed by Max. DTBonjour was previously using a workaround described in Apple’s Technical Q&A 1564. In iOS 7 and OS X this fix is no longer necessary, but rather needs to be disabled. DTBonjour can also be used with multi peer network introduced in iOS 7 thanks to Max’s fixes.

When I asked Max how to use DTBonjour with iOS 7 multi-peer networking, he explained:

Of course, that’s trivial. One simply calls publishWithOptions:NSNetServiceListenForConnections on the NSNetService object and waits for netService:didAcceptConnectionWithInputStream:outputStream: delegate callback. Upon receiving the callback one just needs to init the DTBonjourDataConnection with the given input- and output streams.

On the client side the browser already has the NSNetService from netServiceBrowser:didFindService:moreComing: and therefore just needs to init the DTBonjourDataConnection with the service (initWithService) and open the connection (open). To enable bluetooth connectivity on iOS7 one needs to set the includesPeerToPeer property of the NSNetServiceBrowser and advertising NSNetService to YES.

That’s it. I’ll see if I find the time to create a blog post/sample project from this short introduction.

Simple really…

The update is tagged on GitHub. An updated podspec is also available on CocoaPods.


Tagged as:

Categories: Updates

Leave a Comment