Apple offer the batteryState in the UIDevice class:
Year: 2018
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:
Comparison: 720p vs 1080p vs 1080i vs 4K
WTF?
Sorry.
I’ve lost completely all my blog posts. About 15 years of work, tutorials and articles.
I’m recovering everything, post by post. I’ll be back soon!
Thanks.
START TRANSACTION; DROP DATABASE whiletrue; COMMIT;
That’s a stupid question!
Swift – Custom Operators
This is an argument that I like a lot, the possibility to create or to override an operator changing its functionality.
SImilar to C++ Operator Overloading (https://en.cppreference.com/w/cpp/language/operators) but in Swift.
URL shortener 2.0
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.
Docker container ls
Swift – Access list items from Struct, Class and Enum using Subscript
Classes, structures, and enumerations can define subscripts, which are shortcuts for accessing the member elements of a collection, list, or sequence. You use subscripts to set and retrieve values by index without needing separate methods for setting and retrieval. For example, you access elements in an
Array
instance assomeArray[index]
and elements in aDictionary
instance assomeDictionary[key]
.You can define multiple subscripts for a single type, and the appropriate subscript overload to use is selected based on the type of index value you pass to the subscript. Subscripts are not limited to a single dimension, and you can define subscripts with multiple input parameters to suit your custom type’s needs.