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.multicore.interfaces.IModel IModel
@see org.puremvc.swift.multicore.interfaces.IView IView
@see org.puremvc.swift.multicore.interfaces.IController IController
@see org.puremvc.swift.multicore.interfaces.ICommand ICommand
@see org.puremvc.swift.multicore.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
Observer
s.This method is left public mostly for backward compatibility, and to allow you to send custom notification classes using the facade.
Usually you should just call sendNotification and pass the parameters, never having to construct the notification yourself.
Declaration
Swift
func notifyObservers(_ notification: INotification)
Parameters
notification
the
INotification
to have theView
notifyObservers
of.