IFacade
public protocol IFacade : INotifier
The interface definition for a PureMVC Facade.
The Facade Pattern suggests providing a single class to act as a central point of communication for a subsystem.
In PureMVC, the Facade acts as an interface between the core MVC actors (Model, View, Controller) and the rest of your application.
@see org.puremvc.swift.interfaces.IModel IModel
@see org.puremvc.swift.interfaces.IView IView
@see org.puremvc.swift.interfaces.IController IController
@see org.puremvc.swift.interfaces.ICommand ICommand
@see org.puremvc.swift.interfaces.INotification INotification
-
Check if a Proxy is registered
Declaration
Swift
func hasProxy(_ proxyName: String) -> Bool
Parameters
proxyName
Return Value
whether a Proxy is currently registered with the given
proxyName
. -
Register an
ICommand
with theController
.Declaration
Swift
func registerCommand(_ notificationName: String, closure: @escaping () -> ICommand)
Parameters
noteName
the name of the
INotification
to associate theICommand
with.closure
reference that returns
ICommand
-
Check if a Command is registered for a given Notification
Declaration
Swift
func hasCommand(_ notificationName: String) -> Bool
Parameters
notificationName
Return Value
whether a Command is currently registered for the given
notificationName
. -
Remove a previously registered
ICommand
toINotification
mapping from the Controller.Declaration
Swift
func removeCommand(_ notificationName: String)
Parameters
notificationName
the name of the
INotification
to remove theICommand
mapping for -
Check if a Mediator is registered or not
Declaration
Swift
func hasMediator(_ mediatorName: String) -> Bool
Parameters
mediatorName
Return Value
whether a Mediator is registered with the given
mediatorName
. -
Notify the
IObservers
for a particularINotification
.All previously attached
IObservers
for thisINotification
‘s list are notified and are passed a reference to theINotification
in the order in which they were registered.NOTE: Use this method only if you are sending custom Notifications. Otherwise use the sendNotification method which does not require you to create the Notification instance.
Declaration
Swift
func notifyObservers(_ notification: INotification)
Parameters
notification
the
INotification
to notifyIObservers
of.