Mediator

open class Mediator : Notifier, IMediator

A base IMediator implementation.

`@see org.puremvc.swift.core.View View

  • The name of the Mediator.

    Typically, a Mediator will be written to serve one specific control or group controls and so, will not have a need to be dynamically named.

    Declaration

    Swift

    open class var NAME: String { get }
  • Declaration

    Swift

    public private(set) var name: String { get }
  • Declaration

    Swift

    public weak var viewComponent: AnyObject?
  • Constructor.

    Declaration

    Swift

    public init(name: String? = nil, viewComponent: AnyObject? = nil)

    Parameters

    mediatorName

    the mediator name

    viewComponent

    viewComponent instance

  • List the INotification names this Mediator is interested in being notified of.

    Declaration

    Swift

    open func listNotificationInterests() -> [String]

    Return Value

    Array the list of INotification names

  • Handle INotifications.

    Typically this will be handled in a switch statement, with one ‘case’ entry per INotification the Mediator is interested in.

    Declaration

    Swift

    open func handleNotification(_ notification: INotification)
  • Called by the View when the Mediator is registered

    Declaration

    Swift

    open func onRegister()
  • Called by the View when the Mediator is removed

    Declaration

    Swift

    open func onRemove()