CSSystemInfoHelper 1.4.2

CSSystemInfoHelper 1.4.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2018

Maintained by Cătălin Stan.


Downloads

Total789
Week0
Month0

Installs

Apps29
Test Targets2
powered by Segment

GitHub

Stars1
Watchers1
Forks0
Issues0
Contributors1
Pull Requests0

Code

Files2
LOCLines of Code 132


Version Status Platform Carthage compatible MIT License

CSSystemInfoHelper

A utility library for getting system info. It’s meant to provide a more straightforward way of accessing information only available through C APIs and to provide shorthands for the most common usage scenarios.

I’ve used this library when making the criollo.io website in order to display the system the app is running on.

Getting Started

Installation through CocoaPods

Install using CocoaPods by adding this line to your Podfile:

use_frameworks!

target 'MyApp' do
  pod 'CSSystemInfoHelper', '~> 1.2'
end

In your Project

import CSSystemInfoHelper

print("\(CSSystemInfoHelper.sharedHelper().systemInfoString)"

Examples

Please note that you can also see usage examples in the example app

Getting IPv4 interfaces and addresses

for (ifname, ipaddr) in CSSystemInfoHelper.sharedHelper().AllIPAddresses {
    print("\(ifname): \(ipaddr)")
}

Getting System Info from uname(3)

for (key, value) in CSSystemInfoHelper.sharedHelper().systemInfo {
    print("\(key): \(value)")
}

Getting Human-readable Memory Usage

print(CSSystemInfoHelper.sharedHelper().memoryUsageString)

Getting the device UUID

print(CSSystemInfoHelper.sharedHelper().platformUUID)

on watchOS this cannot yet be done programmatically, so the returned UUID is generated on-the-fly.

What’s Next

Check out the complete documentation on CocoaDocs.