IS2System Class Reference

Inherits from NSObject
Declared in IS2System.h

Overview

IS2System is used to access various system related data and functions, such as the RAM and battery data found in the original InfoStats, and functions such as launching applications.

Device Data

+ batteryPercent

Gives the current percentage of the battery remaining. This value is equal to that shown in the status bar.

+ (int)batteryPercent

Return Value

The currrent battery remaining percentage

Declared In

IS2System.h

+ batteryState

Gives the current state of the battery as a string, which is pre-translated for you.

+ (NSString *)batteryState

Return Value

The currrent battery state

Declared In

IS2System.h

+ batteryStateAsInteger

Gives the current state of the battery as an integer, which may be used if you wish to supply your own strings for each state.

+ (int)batteryStateAsInteger

Return Value

The currrent battery state as an integer

Declared In

IS2System.h

+ ramFree

Gives the current amount of free RAM in megabytes (MB). This is calculated by adding the free RAM to the inactive RAM, since it appears iOS also treats inactive as free.

+ (int)ramFree

Return Value

The currrent amount of free RAM

Declared In

IS2System.h

+ ramUsed

Gives the current amount of used RAM in megabytes (MB).

+ (int)ramUsed

Return Value

The currrent amount of used RAM

Declared In

IS2System.h

+ ramAvailable

Gives the amount of RAM available on the device in megabytes (MB).

+ (int)ramAvailable

Return Value

The amount of available RAM

Declared In

IS2System.h

+ cpuUsage

Gives the current CPU usage in percent (across all available cores)

+ (double)cpuUsage

Return Value

Current CPU usage (combined for system processes and user processes)

Declared In

IS2System.h

+ freeDiskSpaceInFormat:

Gives the current free space left on the device.

+ (double)freeDiskSpaceInFormat:(int)format

Parameters

format

Adjusts the output of the function to be in bytes, kb, MB or GB:
0 - Bytes
1 - kb
2 - MB
3 - GB

Declared In

IS2System.h

+ totalDiskSpaceInFormat:

Gives the amount of space available on the device.

+ (double)totalDiskSpaceInFormat:(int)format

Parameters

format

Adjusts the output of the function to be in bytes, kb, MB or GB:
0 - Bytes
1 - kb
2 - MB
3 - GB

Declared In

IS2System.h

+ networkSpeedUp

Gives the current upload speed of the user’s network connection.

+ (double)networkSpeedUp

Return Value

Up speed in kb/s

Declared In

IS2System.h

+ networkSpeedDown

Gives the current download speed of the user’s network connection.

+ (double)networkSpeedDown

Return Value

Down speed in kb/s

Declared In

IS2System.h

+ networkSpeedUpAutoConverted

Gives the current upload speed of the user’s network connection, which is automatically formatted between b/s to GB/s dependant on the value.

+ (NSString *)networkSpeedUpAutoConverted

Return Value

Up speed, auto formatted

Declared In

IS2System.h

+ networkSpeedDownAutoConverted

Gives the current download speed of the user’s network connection, which is automatically formatted between b/s to GB/s dependant on the value.

+ (NSString *)networkSpeedDownAutoConverted

Return Value

Download speed, auto formatted

Declared In

IS2System.h

+ deviceName

Gives the user-assigned name of the device.

+ (NSString *)deviceName

Return Value

Device name as set by user (eg, “Matt’s iPhone”)

Declared In

IS2System.h

+ deviceType

Gives the device type, eg iPhone, iPad or iPod

+ (NSString *)deviceType

Return Value

Device type

Declared In

IS2System.h

+ deviceModel

Gives the exact model of the current device, eg iPhone7,2

+ (NSString *)deviceModel

Return Value

Device model

Declared In

IS2System.h

+ deviceModelHumanReadable

Gives a more human-friendly version of deviceModel. Eg, iPhone7,2 becomes iPhone 6.

Note that this function will need to be updated each time a new device is released by Apple.

+ (NSString *)deviceModelHumanReadable

Return Value

Device model in a more understandable format

Declared In

IS2System.h

+ deviceDisplayHeight

Gives the height of the device’s display in points. This does not change if the device is rotated.

+ (int)deviceDisplayHeight

Return Value

The height of the display

Declared In

IS2System.h

+ deviceDisplayWidth

Gives the width of the device’s display in points. This does not change if the device is rotated.

+ (int)deviceDisplayWidth

Return Value

The width of the display

Declared In

IS2System.h

+ isDeviceIn24Time

Gives whether the user is using their device in 24hr time, or in 12hr time

+ (BOOL)isDeviceIn24Time

Return Value

Whether device is in 24hr time or not

Declared In

IS2System.h

+ isLockscreenPasscodeVisible

Gives whether the user has the passcode UI visible on their lockscreen at the time of calling.

Please note that this will return NO when the device:
- Is unlocked
- Has not got a passcode set

+ (BOOL)isLockscreenPasscodeVisible

Return Value

Whether passocde UI is currently shown on the lockscreen

Declared In

IS2System.h

System functions

+ takeScreenshot

Takes a screenshot of the current screen, and saves it in the user’s photos.

+ (void)takeScreenshot

Declared In

IS2System.h

+ lockDevice

Locks the device. Doesn’t need much more explanation really.

+ (void)lockDevice

Declared In

IS2System.h

+ openSwitcher

Opens the app switcher.

+ (void)openSwitcher

Declared In

IS2System.h

+ openApplication:

Launches a given application to the foreground.

+ (void)openApplication:(NSString *)bundleIdentifier

Parameters

bundleIdentifier

The bundle identifier of the application to launch

Declared In

IS2System.h

+ openSiri

Opens the Siri interface.

+ (void)openSiri

Declared In

IS2System.h

+ respring

Relaunches SpringBoard immediately after calling.

+ (void)respring

Declared In

IS2System.h

+ reboot

Reboots the device immediately after calling.

+ (void)reboot

Declared In

IS2System.h

+ vibrateDevice

Vibrates the device (triggers an audible alert instead if vibration is not available) for 0.2 seconds. This respects the user setting “Vibrate on Silent” found under Sounds; no vibration will occur when this is turned off.

+ (void)vibrateDevice

Declared In

IS2System.h

+ vibrateDeviceForTimeLength:

Vibrates the device (audible alert if vibration is unavailable) for a custom period of time. This respects the user setting “Vibrate on Silent” found under Sounds; no vibration will occur when this is turned off.

+ (void)vibrateDeviceForTimeLength:(CGFloat)timeLength

Parameters

timeLength

Length of time in seconds to vibrate the device for

Declared In

IS2System.h

Miscellaneous Settings

+ getBrightness

Gives the current backlight level, which will be between 0.0 and 1.0.

+ (CGFloat)getBrightness

Return Value

Current backlight level

Declared In

IS2System.h

+ setBrightness:

Sets the current backlight level, and expects values between 0.0 and 1.0

+ (void)setBrightness:(CGFloat)level

Parameters

level

The new backlight level

Declared In

IS2System.h

+ getLowPowerMode

Gives the current state of the Low Power mode.

This will return NO for versions of iOS less than iOS 9.

+ (BOOL)getLowPowerMode

Return Value

Current Low Power mode state

Declared In

IS2System.h

+ setLowPowerMode:

Sets the current Low Power mode state.

This will do nothing for versions of iOS less than iOS 9.

+ (void)setLowPowerMode:(BOOL)mode

Parameters

mode

The new mode; YES for on, NO for off.

Declared In

IS2System.h

Application Icons

+ getApplicationIconForBundleIdentifier:

Finds the application icon for a given bundle identifier.

Please note this function respects the user’s current theme.

+ (UIImage *)getApplicationIconForBundleIdentifier:(NSString *)bundleIdentifier

Return Value

Application icon for provided bundle identifier

Declared In

IS2System.h

+ getApplicationIconForBundleIdentifierBase64:

Finds the application icon for a given bundle identifier, in the form of a base64 string for usage within a HTML img tag.

Please note this function respects the user’s current theme.

+ (NSString *)getApplicationIconForBundleIdentifierBase64:(NSString *)bundleIdentifier

Return Value

Application icon (in base64 format) for provided bundle identifier

Declared In

IS2System.h