Skip to content

Commit 413d63d

Browse files
committed
update
1 parent 54809e5 commit 413d63d

File tree

8 files changed

+11
-9
lines changed

8 files changed

+11
-9
lines changed

Sources/PureMVC/core/View.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ open class View: IView {
195195
}
196196

197197
// Create Observer referencing this mediator's handlNotification method
198-
let observer = Observer(notifyMethod: mediator.handleNotification, notifyContext: mediator as! Mediator)
198+
let observer = Observer(notifyMethod: mediator.handleNotification, notifyContext: mediator)
199199

200200
let interests = mediator.listNotificationInterests()
201201

Sources/PureMVC/interfaces/IController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ assumes these responsibilities:
2222

2323
`@see org.puremvc.swift.multicore.interfaces ICommand`
2424
*/
25-
public protocol IController {
25+
public protocol IController: AnyObject {
2626

2727
/**
2828
Initialize the `Controller` instance.

Sources/PureMVC/interfaces/IModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ An `IModel` assumes these responsibilities:
1717
* Maintain a cache of `IProxy` instances
1818
* Provide methods for registering, retrieving, and removing `IProxy` instances
1919
*/
20-
public protocol IModel {
20+
public protocol IModel: AnyObject {
2121

2222
/**
2323
Initialize the `Model` instance.

Sources/PureMVC/interfaces/INotification.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using `Notification`s.
3838

3939
`@see org.puremvc.swift.multicore.interfaces.IObserver IObserver`
4040
*/
41-
public protocol INotification {
41+
public protocol INotification: AnyObject {
4242

4343
/// Get the name of the `INotification` instance.
4444
var name: String { get }

Sources/PureMVC/interfaces/INotifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ access to the facade anyway.
2727

2828
`@see org.puremvc.swift.multicore.interfaces.INotification INotification`
2929
*/
30-
public protocol INotifier {
30+
public protocol INotifier: AnyObject {
3131

3232
/**
3333
Send a `INotification`.

Sources/PureMVC/interfaces/IObserver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ as a subclass of `Notification`.
4040

4141
`@see org.puremvc.swift.multicore.interfaces.INotification INotification`
4242
*/
43-
public protocol IObserver {
43+
public protocol IObserver: AnyObject {
4444

4545
/**
4646
Set the notification method.

Sources/PureMVC/interfaces/IView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ In PureMVC, the `View` class assumes these responsibilities:
2626

2727
`@see org.puremvc.swift.multicore.interfaces.INotification INotification`
2828
*/
29-
public protocol IView {
29+
public protocol IView: AnyObject {
3030

3131
/**
3232
Initialize the `View` instance.

Sources/PureMVC/patterns/observer/Notifier.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ open class Notifier : INotifier {
5252

5353
/// Reference to the Facade Multiton
5454
open lazy var facade: IFacade? = {
55-
assert(multitonKey != nil, Notifier.MULTITON_MSG)
55+
guard let key = multitonKey else {
56+
fatalError(Notifier.MULTITON_MSG)
57+
}
5658

5759
// returns instance mapped to multitonKey if it exists otherwise defaults to Facade
58-
return Facade.getInstance(multitonKey!) { key in Facade(key: key) }
60+
return Facade.getInstance(key) { key in Facade(key: key) }
5961
}()
6062

6163
/// Constructor

0 commit comments

Comments
 (0)