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

  • Register an IProxy with the Model by name.

    Declaration

    Swift

    func registerProxy(_ proxy: IProxy)

    Parameters

    proxy

    the IProxy to be registered with the Model.

  • Retrieve a IProxy from the Model by name.

    Declaration

    Swift

    func retrieveProxy(_ proxyName: String) -> IProxy?

    Parameters

    proxyName

    the name of the IProxy instance to be retrieved.

    Return Value

    the IProxy previously regisetered by proxyName with the Model.

  • 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.

  • Remove an IProxy instance from the Model by name.

    Declaration

    Swift

    @discardableResult
    func removeProxy(_ proxyName: String) -> IProxy?

    Parameters

    proxyName

    the IProxy to remove from the Model.

    Return Value

    the IProxy that was removed from the Model

  • Register an ICommand with the Controller.

    Declaration

    Swift

    func registerCommand(_ notificationName: String, closure: @escaping () -> ICommand)

    Parameters

    noteName

    the name of the INotification to associate the ICommand 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 to INotification mapping from the Controller.

    Declaration

    Swift

    func removeCommand(_ notificationName: String)

    Parameters

    notificationName

    the name of the INotification to remove the ICommand mapping for

  • Register an IMediator instance with the View.

    Declaration

    Swift

    func registerMediator(_ mediator: IMediator)

    Parameters

    mediator

    a reference to the IMediator instance

  • Retrieve an IMediator instance from the View.

    Declaration

    Swift

    func retrieveMediator(_ mediatorName: String) -> IMediator?

    Parameters

    mediatorName

    the name of the IMediator instance to retrievve

    Return Value

    the IMediator previously registered with the given mediatorName.

  • 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.

  • Remove a IMediator instance from the View.

    Declaration

    Swift

    @discardableResult
    func removeMediator(_ mediatorName: String) -> IMediator?

    Parameters

    mediatorName

    name of the IMediator instance to be removed.

    Return Value

    the IMediator instance previously registered with the given mediatorName.

  • Notify Observers.

    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 the View notify Observers of.