Latest 0.9.1
Homepage https://github.com/rjstelling/Hostess.swift
License MIT
Platforms ios 9.3, osx 10.12, watchos 3.0, tvos 10.0
Authors

Hostess.swift

Swift
Platform
Carthage compatible
CocoaPods
License

A Swift implementation of NSHost (Host in Swift) that works on iOS, OS X and tvOS.

Hostess.swift is safe to use in a framework because it does not require a bridging header.

Usage

Carthage

Adding Hostess to your Xcode project using Carthage is very straightforward:

github "rjstelling/Hostess" ~> 1.0

Run carthage to download and build the framework.

Cocopods

Installing Hostess using Cocoapods, add the following line to your Podfile:

pod 'Hostess', '~> 1.0'

Then run the pod install command.

Motivation

Hostess.swift was created because NSHost is unavailable on iOS and CFHost does not offer the full functionality of it OS X counterpart.

In addition, those developers hoping for a pure-Swift solution were out of luck without using a bridging header.

Hostess.swift does not use a bridging header, so is safe to use in Framework development. It is 100% Swift and tries to maintain as much type safety as the low level networking C API will allow.

Example

let hostess = Hostess()
let deviceIP = hostess.addresses.first
print("IP: (deviceIP)") // Will print a dot-separated IP address, e.g: 17.24.2.55

What happend to Host.swift?

Host.swift is still available but is considered end of life and I will not be maintaining it.

With the switch to Swift 3 Apple removed the NS prefix from many Foundation classes. This caused Host to clash with the renamed NSHost.

A new name was required… Hostess was chosen.

Latest podspec

{
    "name": "Hostess",
    "version": "0.9.1",
    "summary": "A Swift implementation of NSHost that builds for iOS, macOS and tvOS.",
    "description": "A Swift implementation of NSHost (Host in Swift) that works on iOS, OS X and tvOS. Hostess.swift is safe to use in a framework because it does not require a bridging header.nnHostess.swift was created because NSHost is unavailable on iOS and CFHost does not offer the full functionality of it OS X counterpart. In addition, those developers hoping for a pure-Swift solution were out of luck without using a bridging header. Hostess.swift does not use a bridging header, so is safe to use in Framework development. It is 100% Swift and tries to maintain as much type safety as the low level networking C API will allow.",
    "homepage": "https://github.com/rjstelling/Hostess.swift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Richard Stelling": "[email protected]"
    },
    "social_media_url": "http://twitter.com/rjstelling",
    "platforms": {
        "ios": "9.3",
        "osx": "10.12",
        "watchos": "3.0",
        "tvos": "10.0"
    },
    "source": {
        "git": "https://github.com/rjstelling/Hostess.swift.git",
        "tag": "0.9.1"
    },
    "source_files": [
        "Projects/Hostess/Hostess/",
        "Projects/Hostess/Hostess/**/*.{h,m}"
    ],
    "exclude_files": "Projects/Hostess/Hostess//Exclude",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This