In the main header class of the application, add a static method called sharedController (for example, I am using the fictional class name MainApp):
Then in the main method class of the application, add the code for it, which is a static variable and the sharedController definition:
static volatile uniMag *singletonUnimag = nil;
//Accesses a singleton instance of device class.
static uniMag *SharedInstance = nil;
static dispatch_once_t onceToken;
SharedInstance = [uniMag new];
singletonUnimag = SharedInstance;
Instead of initializing the device as:
unimag* myDevice = [unimag new]; ( or [[unimag alloc] init] )
unimag* myDevice = [MainApp sharedController];
With a singleton, and without any separate activation effort, even on the first time, functions such as ([MainApp sharedController] ReadCardSwipe) may be used.