RVS_MediaServer_AppDelegate
@NSApplicationMain
class RVS_MediaServer_AppDelegate : NSObject, NSApplicationDelegate
This class implements the main application delegate.
It has a couple of class methods and calculated properties that you can use to get a context.
-
This just holds the view controllers that request updates.
Declaration
Swift
private var _notifierClients: [RVS_MediaServer_AppDelegateNotifier?]
-
This holds an observer for our prefs. We need to keep it around in order to remain active.
Declaration
Swift
private var _prefsObserver: NSKeyValueObservation!
-
This is a quick way to get this object instance (it’s a SINGLETON), cast as the correct class.
Declaration
Swift
class var appDelegateObject: RVS_MediaServer_AppDelegate { get }
Return Value
the app delegate object, in its natural environment.
-
This is the prefs object that we’ll use to maintain our persistent state.
Declaration
Swift
@objc dynamic var prefsObject: RVS_MediaServer_PersistentPrefs!
-
Accessor for the prefs state (READ ONLY).
make it dynamic, so that we could attach observers.
Declaration
Swift
@objc dynamic var prefs: RVS_MediaServer_PersistentPrefs { get }
-
This displays a simple alert, with an OK button.
Declaration
Swift
class func displayAlert(header inHeader: String, message inMessage: String = "")
Parameters
header
The header to display at the top.
message
A String, containing whatever messge is to be displayed below the header.
-
This adds a notifier to our list (if not already there).
Declaration
Swift
func addNotifier(_ inNotifier: RVS_MediaServer_AppDelegateNotifier)
Parameters
inNotifier
The notifier (View Controller) to be added.
-
This removes a notifier from our list.
Declaration
Swift
func removeNotifier(_ inNotifier: RVS_MediaServer_AppDelegateNotifier)
Parameters
inNotifier
The notifier (View Controller) to be removed.
-
This sends UI updates to all registered notifier clients.
Declaration
Swift
func forceUpdate()
-
Called after the application has completed its launch preparations and allocations.
Declaration
Swift
func applicationDidFinishLaunching(_ inNotification: Notification)
Parameters
inNotification
The notification that accompanied the application launch.