Apple offer the batteryState in the UIDevice class:
ios12
Swift – UIDevice orientations using iOS12
In iOS12 Apple introduced a new way to check if your device is in “flat” mode, or better is on your desk.
Let’s take a look at the reference:
Swift – Natural language recognizer
Hi!
with iOS 12, Apple released a new framework for language recognition and other interesting stuff. Is called NLLanguageRecognizer.
Use the Natural Language framework to perform tasks like language and script identification, tokenization, lemmatization, parts-of-speech tagging, and named entity recognition. You can also use this framework with Create ML to train and deploy custom natural language models.