Skip to content

Commit 3ff4c0f

Browse files
committed
update
1 parent d31c895 commit 3ff4c0f

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

Sources/PureMVC/interfaces/IFacade.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ public protocol IFacade: INotifier {
6464
Register an `ICommand` with the `Controller`.
6565

6666
- parameter noteName: the name of the `INotification` to associate the `ICommand` with.
67-
- parameter closure: reference that returns `ICommand`
67+
- parameter factory: closure that returns `ICommand`
6868
*/
69-
func registerCommand(_ notificationName: String, closure: @escaping () -> ICommand)
69+
func registerCommand(_ notificationName: String, factory: @escaping () -> ICommand)
7070

7171
/**
7272
Check if a Command is registered for a given Notification

Sources/PureMVC/patterns/facade/Facade.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ open class Facade: IFacade {
4747
This `IFacade` implementation is a Multiton,
4848
so you should not call the constructor
4949
directly, but instead call the static Factory method,
50-
passing the unique key for this instance and the closure reference
50+
passing the unique key for this instance and the factory closure
5151
that returns the `IFacade` implementation.
5252
`Facade.getInstance( multitonKey ) { Facade(key: multitonKey) }`
5353

@@ -159,10 +159,10 @@ open class Facade: IFacade {
159159
Register an `ICommand` with the `Controller` by Notification name.
160160

161161
- parameter notificationName: the name of the `INotification` to associate the `ICommand` with
162-
- parameter closure: reference that returns `ICommand`
162+
- parameter factory: reference that returns `ICommand`
163163
*/
164-
open func registerCommand(_ notificationName: String, closure: @escaping () -> ICommand) {
165-
controller.registerCommand(notificationName, factory: closure)
164+
open func registerCommand(_ notificationName: String, factory: @escaping () -> ICommand) {
165+
controller.registerCommand(notificationName, factory: factory)
166166
}
167167

168168
/**

Sources/PureMVC/patterns/mediator/Mediator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ open class Mediator: Notifier, IMediator {
3131
/**
3232
Constructor.
3333

34-
- parameter mediatorName: the mediator name
34+
- parameter name: the mediator name
3535
- parameter viewComponent: viewComponent instance
3636
*/
3737
public init(name: String?=nil, viewComponent: AnyObject?=nil) {

Tests/PureMVCTests/patterns/facade/FacadeTest.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class FacadeTest: XCTestCase {
5252
// Create the Facade, register the FacadeTestCommand to
5353
// handle 'FacadeTest' notifications
5454
let facade = Facade.getInstance("FacadeTestKey2", factory: { key in Facade(key: key) })
55-
facade.registerCommand("FacadeTestNote", closure: { FacadeTestCommand()} )
55+
facade.registerCommand("FacadeTestNote", factory: { FacadeTestCommand()} )
5656

5757
// Send notification. The Command associated with the event
5858
// (FacadeTestCommand) will be invoked, and will multiply
@@ -80,7 +80,7 @@ class FacadeTest: XCTestCase {
8080
// Create the Facade, register the FacadeTestCommand to
8181
// handle 'FacadeTest' events
8282
let facade = Facade.getInstance("FacadeTestKey3", factory: {key in Facade(key: key)}) as! Facade
83-
facade.registerCommand("FacadeTestNote", closure: {FacadeTestCommand()})
83+
facade.registerCommand("FacadeTestNote", factory: {FacadeTestCommand()})
8484
facade.removeCommand("FacadeTestNote")
8585

8686
// Send notification. The Command associated with the event
@@ -200,7 +200,7 @@ class FacadeTest: XCTestCase {
200200
func testHasCommand() {
201201
// register the ControllerTestCommand to handle 'hasCommandTest' notes
202202
let facade = Facade.getInstance("FacadeTestKey10", factory: { key in Facade(key: key) })
203-
facade.registerCommand("facadeHasCommandTest", closure: {FacadeTestCommand()})
203+
facade.registerCommand("facadeHasCommandTest", factory: {FacadeTestCommand()})
204204

205205
// test that hasCommand returns true for hasCommandTest notifications
206206
XCTAssertTrue(facade.hasCommand("facadeHasCommandTest"), "Expecting facade.hasCommand('facadeHasCommandTest') == true")

Tests/PureMVCTests/patterns/facade/ShellFacade.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ShellFacade: Facade {
1616

1717
public override func initializeController() {
1818
super.initializeController()
19-
registerCommand(ShellFacade.TestCommand, closure: {FacadeTestCommand2()})
19+
registerCommand(ShellFacade.TestCommand, factory: {FacadeTestCommand2()})
2020
}
2121

2222
public func startup(vo: FacadeTestVO) {

Tests/PureMVCTests/patterns/observer/NotifierTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NotifierTest: XCTestCase {
3030
XCTAssertTrue(Facade.hasCore("notifierTest"), "Expecting Facade.hasCore('notifierTest') == true")
3131

3232
let vo = FacadeTestVO(input: 5)
33-
facade.registerCommand("testCommand", closure: {FacadeTestCommand()})
33+
facade.registerCommand("testCommand", factory: {FacadeTestCommand()})
3434

3535
let notifier = Notifier()
3636
notifier.initializeNotifier("notifierTest")

0 commit comments

Comments
 (0)