Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rjstelling/Host.swift
*Host.swift is no longer maintained*, please use Hostess.swift: https://github.com/rjstelling/Hostess.swift. A Swift implementation of NSHost that works on iOS, OS X and tvOS. Host.swift is safe to use in a framework because it does not require a bridging header.
https://github.com/rjstelling/Host.swift
host-swift hostess-swift ios macos swift tvos watchos
Last synced: 3 months ago
JSON representation
*Host.swift is no longer maintained*, please use Hostess.swift: https://github.com/rjstelling/Hostess.swift. A Swift implementation of NSHost that works on iOS, OS X and tvOS. Host.swift is safe to use in a framework because it does not require a bridging header.
- Host: GitHub
- URL: https://github.com/rjstelling/Host.swift
- Owner: rjstelling
- License: other
- Created: 2016-05-20T23:10:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-27T13:30:25.000Z (almost 8 years ago)
- Last Synced: 2024-07-27T18:54:32.093Z (4 months ago)
- Topics: host-swift, hostess-swift, ios, macos, swift, tvos, watchos
- Language: Swift
- Homepage: https://github.com/rjstelling/Hostess.swift
- Size: 398 KB
- Stars: 81
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Host.swift is no longer maintained
Please use Hostess.swift: https://github.com/rjstelling/Hostess.swift
[![Host.swift](https://github.com/rjstelling/Host.swift/blob/master/Resources/Hero.png)](#)
[![Swift](https://img.shields.io/badge/Swift-2.2-orange.svg?style=flat)](#)
[![Platform](https://img.shields.io/badge/Platform-iOS, macOS & tvOS-lightgrey.svg?style=flat)](#)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/rjstelling/Host.swift/blob/master/LICENSE)A Swift implementation of NSHost that works on iOS, OS X and tvOS.
Host.swift is safe to use in a framework because it does not require a bridging header.
##Motivation
Host.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.
Host.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
``` swift
let host = Host()
let deviceIP = host.addresses.first
print("IP: \(deviceIP)") // Will print a dot-separated IP address, e.g: 17.24.2.55
```