CGA_AppDelegate
@UIApplicationMain
class CGA_AppDelegate : UIResponder
extension CGA_AppDelegate: UIApplicationDelegate
This implements the main application delegate functionality.
-
This is the Bluetooth Central Manager instance. Everything goes through this.
Declaration
Swift
static var centralManager: RVS_BlueThoth?
-
Quick access to the app delegate object.
Declaration
Swift
class var appDelegateObject: CGA_AppDelegate! { get }
-
The required window instance.
Declaration
Swift
var window: UIWindow?
-
This will contain our persistent prefs
Declaration
Swift
var prefs: CGA_PersistentPrefs
-
Displays the given message and title in an alert with an “OK” button.
Declaration
Swift
class func displayAlert(header inHeader: String, message inMessage: String = "", presentedBy inPresentingViewController: UIViewController! = nil)
Parameters
header
a string to be displayed as the title of the alert. It is localized by this method.
message
a string to be displayed as the message of the alert. It is localized by this method.
presentedBy
An optional UIViewController object that is acting as the presenter context for the alert. If nil, we use the top controller of the Navigation stack.
-
This creates an Array of String, containing the advertisement data from the indexed device.
Declaration
Swift
class func createAdvertimentStringsFor(_ inIndex: Int) -> [String]
Parameters
inIndex
The 0-based index of the device to fetch.
Return Value
An Array of String, with the advertisement data in “key: value” form.
-
This creates an Array of String, containing the advertisement data from the indexed device.
Declaration
Swift
class func createAdvertimentStringsFor(_ inAdData: RVS_BlueThoth.AdvertisementData?, id inID: String) -> [String]
Parameters
inAdData
The advertisement data.
id
The ID string.
Return Value
An Array of String, with the advertisement data in “key: value” form.
-
Called when the application has completed its launch setup.
Declaration
Swift
func application(_: UIApplication, didFinishLaunchingWithOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool
Parameters
didFinishLaunchingWithOptions
The launch options, as a Dictionary.
Return Value
true, if the application to finish launch. False will abort the launch.