Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.

Overview

Luminous

Luminous

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 8+
  • Swift 5
  • Xcode 10

Installation

Luminous is available through CocoaPods and Swift Package Manager.

CocoaPods

To install it, simply add the following line to your Podfile:

pod "Luminous"

Then use import Luminous wherever you want to use the library.

Swift Package Manager

To add Luminous to your Xcode project, select File -> Swift Packages -> Add Package Depedancy. Enter https://github.com/andrealufino/Luminous for the URL. Check the use branch option and enter master.

Manually

Download the project and drag all the files present in Luminous -> Luminous -> Sources into your project. The library depends from the Deviice framework. Download it and do the same with it (dragging Deviice.swift).

Dependencies

Luminous has only 1 dependency : Deviice which is my other library useful to know on which device your app is running on, plus some nice information.

Migration to version 2

In version 2, I've changed some things and added others. An important change has been made to the structure of the library, useful for who wants to contribute to the project and to who wants to fork it. I created a specific file (extension) for every substruct.

Changed

  • LMBatteryState has been renamed to BatteryState
  • LMSizeScale has been renamed to MeasureUnit
  • Luminous.Carrier.allowsVOIP has been renamed to isVoipAllowed
  • Luminous.Hardware.physicalMemory(withScale: _) now returns a Double and no more a Float
  • All the structs are now accessible using Luminous. as I removed the System middleware struct since it became useless
  • NSLocale is no more used in the library. I switched to Locale
  • Disk substruct now has a new method to return the totalSpace, freeSpace and usedSpace that takes a MeasureUnit parameter as input. The old vars that returned String and percentage have been deprecated and will be removed in the next version

Added

  • Audio (thanks to GregOriol)
    • currentAudioOutputVolume
    • secondaryAudioShouldBeSilencedHint
  • SystemVersion (from version 2.1.0) : this has been added under the Hardware struct and represents the system version

What is Luminous?

Luminous is the son of ALSystemUtilities library which is no longer maintained (it still is my best library on github). I got ideas from that one and I wrote everything from scratch in Swift adding some new feature and designing it in a different way thanks to the differences between Objective-C and Swift.

Luminous is a big library that I like to consider an "Helper Library". It provides a lot of information about the system and has some features that can speed up significantly the development process.

It is composed by 3 parts : - system information (Luminous.System.) - utils (some handy method like the email check) - custom app configuration

Luminous is no more composed by 3 parts as I think that a library has to serve one and one only purpose. I removed the Utils and AppConfiguration structs. I'm sorry for any kind of inconvenience this could cause to everyone is using it, but I think that it's the right choice.

System information

Here I provide tons of information about the system and you can access them using the notation Luminous..

There are 11 different substructs here from which you can get information :

  • Network
    • isConnectedViaWiFi
    • isConnectedViaCellular
    • SSID (deprecated on iOS 13)
  • Locale
    • currentLanguage
    • currentTimeZone
    • currentTimeZoneName
    • currentCountry
    • currentCurrency
    • currentCurrencySymbol
    • usesMetricSystem
    • decimalSeparator
  • Carrier
    • name
    • ISOCountryCode
    • mobileCountryCode
    • networkCountryCode (deprecated, use mobileNetworkCode instead)
    • mobileNetworkCode
    • allowsVOIP
  • Hardware
    • SystemVersion struct
    • processorsNumber
    • activeProcessorsNumber
    • physicalMemory
    • systemName
    • systemVersion (this is a SystemVersion struct from version 2.1.0, no more a String)
    • bootTime
    • isLowPowerModeEnabled
    • Screen
      • brightness
      • isScreenMirrored
      • nativeBounds
      • nativeScale
      • bounds
      • scale
      • snapshotOfCurrentView
    • Device
      • current (returns a Deviice object)
      • identifierForVendor
      • orientation
    • Accessory
      • count
      • connectedAccessoriesNames
      • connectedAccessories
    • Sensors
      • isAccelerometerAvailable
      • isGyroAvailable
      • isMagnetometerAvailable
      • isDeviceMotionAvailable
  • Audio
    • currentAudioOutputVolume
    • secondaryAudioShouldBeSilencedHint
  • Disk
    • totalSpace
    • freeSpace
    • usedSpace
    • totalSpaceInBytes
    • freeSpaceInBytes
    • usedSpaceInBytes
    • freeSpaceInPercentage
    • usedSpaceInPercentage
  • Battery
    • level
    • state
  • Application
    • version
    • build
    • completeAppVersion
    • clipboardString

Why Luminous?

I'm sure you're asking yourself "Why this library is called Luminous?". Well, stop think about it. The reason is simple : I like the word "Luminous", it gives me a unique feeling of something that is bright and awesome! So, I chose to call this lib in that way! But you can think that "Luminous is because this library will light up your way of development speeding up it and giving you more time for yourself", this is more philosophical.

Help

Any suggestion would be really appreciated. The library is designed using structs and static functions, but I'm still not sure of this choice. I'm struggling if the best is to use static functions or static vars, so this is the first point you can help me with.

Author

Andrea Mario Lufino, [email protected].

License

Luminous is available under the MIT license. See the LICENSE file for more info.

Comments
  • replace functions with vars

    replace functions with vars

    There are many functions without arguments.

    It would be nice if parenthesis can be omitted.

    Instead of invoking isConnectedViaWiFi(), then invoke isConnectedViaWiFi

    enhancement 
    opened by neoneye 4
  • Luminous.Carrier.networkCountryCode should be .mobileNetworkCode

    Luminous.Carrier.networkCountryCode should be .mobileNetworkCode

    I haven't use this library, just saw your source code.

    I think Luminous.Carrier.networkCountryCode should be .mobileNetworkCode(MNC) in https://github.com/andrealufino/Luminous/blob/master/Luminous/Classes/Luminous.swift

    opened by ethanhuang13 2
  • Problems with SystemVersion

    Problems with SystemVersion

    Hi @andrealufino,

    I have 2 issues with the SystemVersion struct: 1/ it seems that major, minor and path values are currently all set to the "first" component

                major = Int(components.first!)!
                minor = Int(components.first!)!
                patch = Int(components.first!)!
    

    which doesn't seem correct?

    2/ there doesn't seem to be any way to retrieve any of the values, either major/minor/patch or the full string value as everything is private, which makes it mostly useless?

    opened by GregOriol 1
  • No more CNCopyCurrentNetworkInfo access

    No more CNCopyCurrentNetworkInfo access

    iOS 13 breaking change on SSID network

    Apple does not grant access to CNCopyCurrentNetworkInfo API anymore, as communicated by Apple on August 7th, 2019 :

    As we announced at WWDC19, we're making changes to further protect user privacy and prevent unauthorized location tracking. Starting with iOS 13, the CNCopyCurrentNetworkInfo API will no longer return valid Wi-Fi SSID and BSSID information.

    Instead, the information returned by default will be: 



    • SSID: “Wi-Fi” or “WLAN” (“WLAN" will be returned for the China SKU)
    • BSSID: "00:00:00:00:00:00" 

If your app is using this API, we encourage you to adopt alternative approaches that don’t require Wi-Fi or network information.

    Valid SSID and BSSID information from CNCopyCurrentNetworkInfo will still be provided to VPN apps, apps that have used NEHotspotConfiguration to configure the current Wi-Fi network, and apps that have obtained permission to access user location through Location Services. 

Test your app on the latest iOS 13 beta to make sure it works properly.

    If your app requires valid Wi-Fi SSID and BSSID information to function, you can do the following: • For accessory setup apps, use the NEHotSpotConfiguration API, which now has the option to pass a prefix of the SSID hotspot your app expects to connect to. • For other types of apps, use the CoreLocation API to request the user’s consent to access location information.

    Solution

    • Use alternative API to get SSID information
    opened by bill350 1
  • Add audio output volume information

    Add audio output volume information

    It could be possible to add current audio output volume information this way:

    try? AVAudioSession.sharedInstance().setActive(true)
    volume = AVAudioSession.sharedInstance().outputVolume
    try? AVAudioSession.sharedInstance().setActive(false)
    

    What do you think?

    opened by GregOriol 1
  • Wrong function called

    Wrong function called

    Hi,

    In the file Luminous.swift, var usedSpace:

    /// The used disk space in string format (megabytes)
    public static var usedSpace: String {
        return ByteCountFormatter.string(fromByteCount: freeSpaceInBytes, countStyle: ByteCountFormatter.CountStyle.binary)
    }
    

    freeSpaceInBytes are called, instead of usedSpaceInBytes

    opened by skrew 1
  • Carthage installation

    Carthage installation

    opened by ghost 1
  • Manual Installation

    Manual Installation

    CocoaPods and Carthage are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.

    It would be cool to add the Manual installation guide in your README.md. You can take a look at my iOS Readme Template to see how you can do it.

    opened by lfarah 1
  • Fix for playback pausing when getting volume

    Fix for playback pausing when getting volume

    There is an issue with the current implementation of Audio's currentAudioOutputVolume: when called, any playback that is going on (AVPlayer, ...) will pause. By applying this change, playbacks will continue as expected.

    Please note that I don't know the impact of not setting active to false. As far as I can tell there is no problem, and it's likely even less a problem when the app actually is using or going to use audio.

    opened by GregOriol 0
  • Obj-c Compatibility

    Obj-c Compatibility

    I realize that everything built in this library is a public struct, which means it isn't accessible via obj-c... any chance you can make an obj-c compatible version?

    Would be FIRE

    Thanks.

    opened by Dellybro 0
  • Fix problem sample project can not build with Xcode 9.3.1

    Fix problem sample project can not build with Xcode 9.3.1

    Hi, thank you for your great project. I tried to build sample project included this repository, but unfortunately Xcode raise linker error and could not build. Here is error message.

    Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_EAAccessory", referenced from:
          objc-class-ref in ViewController.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    Solution

    Add ExternalAccessory.framework in Xcode Luminous_Example -> Build Phases -> Link BInary With Libraries. It worked fine in my machine. (macOS 10.13.4 and Xcode 9.3.1)

    opened by Kesin11 0
  • Is Deviice actually used in Luminous?

    Is Deviice actually used in Luminous?

    From a quick search in the code, I don't seem to find any reference to Deviice/Device in the current Luminous code; is the dependency actually used? or planned to be used? or could it be removed?

    opened by GregOriol 1
  • Add Wi-Fi disabled information

    Add Wi-Fi disabled information

    It seems that, in addition to reachability information, there could be a way to check for Wi-Fi enabled/disabled: https://github.com/alirp88/SMTWiFiStatus It could be an interesting information to add.

    What do you think?

    opened by GregOriol 2
Owner
Andrea Mario Lufino
Senior iOS Developer 👨🏻‍💻
Andrea Mario Lufino
Pretend you have the latest MacBook Pro!

Notch Simulator Pretend you have the latest MacBook Pro! Download Thank you, everyone! Notch Simulator has been downloaded over 2000 times! ?? Twitter

Megabits_mzq 666 Dec 23, 2022
Launch JIT enabled iOS app with a second iOS device

Jitterbug This app uses libimobiledevice and WiFi pairing to use one iOS device to launch apps with the debugger on another iOS device. This "tethered

null 645 Jan 6, 2023
Light weight tool for detecting the current device and screen size written in swift.

Device detect the current  device model and screen size. Installation CocoaPods Device is available through CocoaPods. To install it, simply add the

Lucas Ortis 1.5k Dec 28, 2022
Swift library to easily check the current device and some more info about it.

Usage To run the example project, clone the repo, and run pod install from the Example directory first. let device = Deviice.current device is a Devi

Andrea Mario Lufino 56 Nov 3, 2022
Thingy - A modern device detection and querying library.

Thingy A modern device detection and querying library. Features Swift 5 support Modern syntax Documentation Device detection Device family detection D

Bojan Dimovski 58 Oct 5, 2022
The purpose of this repository is to serve as an example for writing a SwiftUI IOS app for connecting to an HM-10 over Bluetooth Low Energy

The purpose of this repository is to serve as an example for writing a SwiftUI IOS app for connecting to an HM-10 over Bluetooth Low Energy. The example provided also sends the IOS devices location over BLE to the HM-10, when the button is pressed. An example Arduino program is provided that allows the user to receive messages from the IOS device on the HM-10.

Jeremiah Givens 1 Nov 21, 2022
Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.

Luminous Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 8+ Swift 5 Xcode 1

Andrea Mario Lufino 324 Nov 27, 2022
Snitch - A handy library to access useful information about your application from the Home Screen

Snitch Access your app's useful information from Home Screen Table of Contents I

Tamerlan Satualdypov 12 Jan 2, 2023
Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state.

Prephirences - Preϕrences Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, co

Eric Marchand 557 Nov 22, 2022
Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults

Prephirences - Preϕrences Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, co

Eric Marchand 557 Nov 22, 2022
SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

Gymshark 1 Jul 6, 2021
This to learn such as : Add Target , NSNotification Center Send/Get Data , Observer Override , resize Data By Byte , UIImagePicker Delegate , UIAlert Handle , Top ViewController , Get pickerController

Technicalisto How to Create UIButton Class to Pick Data Image Purpose Learn this topics With exact Task Add Target NSNotification Center Send/Get Data

Aya Baghdadi 1 Feb 20, 2022
A simple to use iOS/tvOS/watchOS SDK to help get you off the ground quickly and efficiently with your Elastic Path Commerce Cloud written in Swift.

Elastic Path Commerce Cloud iOS Swift SDK A simple to use iOS/tvOS/watchOS SDK to help get you off the ground quickly and efficiently with your Elasti

Moltin 36 Aug 1, 2022
Virgil Core SDK allows developers to get up and running with Virgil Cards Service API quickly and add end-to-end security to their new or existing digital solutions to become HIPAA and GDPR compliant and more.

Virgil Core SDK Objective-C/Swift Introduction | SDK Features | Installation | Configure SDK | Usage Examples | Docs | Support Introduction Virgil Sec

Virgil Security, Inc. 27 Jul 26, 2022
Nobetci Eczacim is open-source App Store Application which users can get pharmacy information and location easily and safely.

Pharmacy-On-Duty Nobetci Eczacim Project Description This project designed for make it easier for people to search for a pharmacy on duty. App Store A

Mert Demirtas 5 Sep 19, 2022
swift-highlight a pure-Swift data structure library designed for server applications that need to store a lot of styled text

swift-highlight is a pure-Swift data structure library designed for server applications that need to store a lot of styled text. The Highlight module is memory-efficient and uses slab allocations and small-string optimizations to pack large amounts of styled text into a small amount of memory, while still supporting efficient traversal through the Sequence protocol.

kelvin 4 Aug 14, 2022
Strucure: I used MVVM with Colusre binging modular architecture : Also I used openweathermap to get all information for current weather as it's easy t

Strucure: I used MVVM with Colusre binging modular architecture : Also I used openweathermap to get all information for current weather as it's easy t

Alaa Azab 0 Oct 7, 2021
reward the user for watching videos to get coins then use them to get rid of annoying admob ads

reward the users for watching youtube videos to the end to earn coins, then use them to get rid of annoying admob ads like banners, interstitial & reward videos

Belal Samy 4 Nov 19, 2021
COVID Safe Paths (based on Private Kit) is an open and privacy preserving system to use personal information to battle COVID

COVID Safe Paths is a mobile app for digital contract tracing (DCT) sponsored by Path Check a nonprofit and developed by a growing global community of engineers, designers, and contributors. Safe Paths is based on research originally conducted at the MIT Media Lab.

PathCheck Foundation 470 Nov 6, 2022
A Flutter plugin (platform channel with Swift) to get the current app name and also bring our app to the front.

window_to_front A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package th

Minas Giannekas 1 Nov 13, 2021