Model
open class Model : IModel
A Singleton IModel
implementation.
In PureMVC, the Model
class provides
access to model objects (Proxies) by named lookup.
The Model
assumes these responsibilities:
- Maintain a cache of
IProxy
instances. - Provide methods for registering, retrieving, and removing
IProxy
instances.
Your application must register IProxy
instances
with the Model
. Typically, you use an
ICommand
to create and register IProxy
instances once the Facade
has initialized the Core
actors.
@see org.puremvc.swift.patterns.proxy.Proxy Proxy
@see org.puremvc.swift.interfaces.IProxy IProxy
-
Constructor.
This
IModel
implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton Factory methodModel.getInstance()
@throws Error Error if Singleton instance has already been constructed
Declaration
Swift
public init()
-
Initialize the Singleton
Model
instance.Called automatically by the constructor, this is your opportunity to initialize the Singleton instance in your subclass without overriding the constructor.
Declaration
Swift
open func initializeModel()
-
Check if a Proxy is registered
Declaration
Swift
open func hasProxy(_ proxyName: String) -> Bool
Parameters
proxyName
Return Value
whether a Proxy is currently registered with the given
proxyName
.