GithubHelp home page GithubHelp logo

rjstelling / hostess.swift Goto Github PK

View Code? Open in Web Editor NEW
30.0 3.0 7.0 1.38 MB

A Swift implementation of NSHost 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. Hostess is Swift 4.0 (or newer) only and replaces the Swift 2.x only Host.swift.

License: Other

Objective-C 2.25% Swift 68.22% Ruby 29.53%
swift tvos ios macos ip-address clang-modules nshost host-swift iphone ipad apple-tv hostess-swift hostess watchos swift3

hostess.swift's Introduction

Hostess.swift

Swift Platform Carthage compatible CocoaPods License

UPDATE 2019: HOSTESS CANNOT READ THE SSID AS OF IOS 13

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.swift"

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.

hostess.swift's People

Contributors

albinekcom avatar matthewryan avatar nickhingston avatar rjstelling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hostess.swift's Issues

no CocoaPod version 1.0

After I copied the line from your Git readme into my Podfile, output:

% pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Hostess":
In Podfile:
Hostess (~> 1.0)

None of your spec sources contain a spec satisfying the dependency: Hostess (~> 1.0).

You have either:

  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.