Skip to content

Commit 54809e5

Browse files
committed
update
updated docs
1 parent 3c78b9f commit 54809e5

File tree

174 files changed

+162
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+162
-244
lines changed

Sources/PureMVC/interfaces/INotifier.swift

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,7 @@ public protocol INotifier {
3939
- parameter body: the body of the notification
4040
- parameter type: the type of the notification
4141
*/
42-
func sendNotification(_ notificationName: String, body: Any, type: String)
43-
44-
/**
45-
Send a `INotification`.
46-
47-
Convenience method to prevent having to construct new
48-
notification instances in our implementation code.
49-
50-
- parameter notificationName: the name of the notification to send
51-
- parameter body: the body of the notification
52-
*/
53-
func sendNotification(_ notificationName: String, body: Any)
54-
55-
/**
56-
Send a `INotification`.
57-
58-
Convenience method to prevent having to construct new
59-
notification instances in our implementation code.
60-
61-
- parameter notificationName: the name of the notification to send
62-
*/
63-
func sendNotification(_ notificationName: String)
42+
func sendNotification(_ notificationName: String, body: Any?, type: String?)
6443

6544
/**
6645
Initialize this INotifier instance.

Sources/PureMVC/patterns/facade/Facade.swift

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -272,35 +272,10 @@ open class Facade: IFacade {
272272
- parameter body: the body of the notification (
273273
- parameter type: the type of the notification
274274
*/
275-
open func sendNotification(_ notificationName: String, body: Any, type: String) {
275+
open func sendNotification(_ notificationName: String, body: Any? = nil, type: String? = nil) {
276276
notifyObservers(Notification(name: notificationName, body: body, type: type))
277277
}
278278

279-
/**
280-
Create and send an `INotification`.
281-
282-
Keeps us from having to construct new notification
283-
instances in our implementation code.
284-
285-
- parameter notificationName: the name of the notiification to send
286-
- parameter body: the body of the notification (optional)
287-
*/
288-
open func sendNotification(_ notificationName: String, body: Any) {
289-
notifyObservers(Notification(name: notificationName, body: body))
290-
}
291-
292-
/**
293-
Create and send an `INotification`.
294-
295-
Keeps us from having to construct new notification
296-
instances in our implementation code.
297-
298-
- parameter notificationName: the name of the notiification to send
299-
*/
300-
open func sendNotification(_ notificationName: String) {
301-
notifyObservers(Notification(name: notificationName))
302-
}
303-
304279
/**
305280
Notify `Observer`s.
306281

Sources/PureMVC/patterns/observer/Notifier.swift

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -73,35 +73,10 @@ open class Notifier : INotifier {
7373
- parameter body: the body of the notification (optional)
7474
- parameter type: the type of the notification (optional)
7575
*/
76-
open func sendNotification(_ notificationName: String, body: Any, type: String) {
76+
open func sendNotification(_ notificationName: String, body: Any? = nil, type: String? = nil) {
7777
facade?.sendNotification(notificationName, body: body, type: type)
7878
}
7979

80-
/**
81-
Create and send an `INotification`.
82-
83-
Keeps us from having to construct new INotification
84-
instances in our implementation code.
85-
86-
- parameter notificationName: the name of the notification to send
87-
- parameter body: the body of the notification (optional)
88-
*/
89-
open func sendNotification(_ notificationName: String, body: Any) {
90-
facade?.sendNotification(notificationName, body: body)
91-
}
92-
93-
/**
94-
Create and send an `INotification`.
95-
96-
Keeps us from having to construct new INotification
97-
instances in our implementation code.
98-
99-
- parameter notificationName: the name of the notification to send
100-
*/
101-
open func sendNotification(_ notificationName: String) {
102-
facade?.sendNotification(notificationName)
103-
}
104-
10580
/**
10681
Initialize this INotifier instance.
10782

Tests/PureMVCTests/patterns/facade/FacadeTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class FacadeTest: XCTestCase {
5858
// (FacadeTestCommand) will be invoked, and will multiply
5959
// the vo.input value by 2 and set the result on vo.result
6060
let vo = FacadeTestVO(input: 32)
61-
facade?.sendNotification("FacadeTestNote", body: vo)
61+
facade?.sendNotification("FacadeTestNote", body: vo, type: nil)
6262

6363
// test assertions
6464
XCTAssertTrue(vo.result == 64, "Expecting vo.result == 64)")

docs/data/documentation/puremvc.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/data/documentation/puremvc/controller.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"abstract":[{"text":"If an ","type":"text"},{"code":"ICommand","type":"codeVoice"},{"text":" has previously been registered","type":"text"},{"text":" ","type":"text"},{"text":"to handle a the given ","type":"text"},{"code":"INotification","type":"codeVoice"},{"text":", then it is executed.","type":"text"}],"primaryContentSections":[{"declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"executeCommand"},{"kind":"text","text":"("},{"kind":"externalParam","text":"_"},{"kind":"text","text":" "},{"kind":"internalParam","text":"notification"},{"kind":"text","text":": any "},{"identifier":"doc:\/\/PureMVC\/documentation\/PureMVC\/INotification","kind":"typeIdentifier","preciseIdentifier":"s:7PureMVC13INotificationP","text":"INotification"},{"kind":"text","text":")"}]}],"kind":"declarations"},{"kind":"parameters","parameters":[{"name":"notification","content":[{"type":"paragraph","inlineContent":[{"text":"An ","type":"text"},{"type":"codeVoice","code":"INotification"}]}]}]}],"hierarchy":{"paths":[["doc:\/\/PureMVC\/documentation\/PureMVC","doc:\/\/PureMVC\/documentation\/PureMVC\/Controller"]]},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PureMVC\/documentation\/PureMVC\/Controller\/executeCommand(_:)"},"kind":"symbol","sections":[],"schemaVersion":{"major":0,"minor":3,"patch":0},"variants":[{"paths":["\/documentation\/puremvc\/controller\/executecommand(_:)"],"traits":[{"interfaceLanguage":"swift"}]}],"metadata":{"fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"executeCommand","kind":"identifier"},{"text":"(any ","kind":"text"},{"preciseIdentifier":"s:7PureMVC13INotificationP","text":"INotification","kind":"typeIdentifier"},{"text":")","kind":"text"}],"externalID":"s:7PureMVC10ControllerC14executeCommandyyAA13INotification_pF","modules":[{"name":"PureMVC"}],"roleHeading":"Instance Method","role":"symbol","symbolKind":"method","title":"executeCommand(_:)"},"references":{"doc://PureMVC/documentation/PureMVC/Controller/executeCommand(_:)":{"role":"symbol","identifier":"doc:\/\/PureMVC\/documentation\/PureMVC\/Controller\/executeCommand(_:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"executeCommand"},{"kind":"text","text":"(any "},{"kind":"typeIdentifier","text":"INotification","preciseIdentifier":"s:7PureMVC13INotificationP"},{"kind":"text","text":")"}],"type":"topic","abstract":[{"type":"text","text":"If an "},{"code":"ICommand","type":"codeVoice"},{"type":"text","text":" has previously been registered"},{"type":"text","text":" "},{"type":"text","text":"to handle a the given "},{"code":"INotification","type":"codeVoice"},{"type":"text","text":", then it is executed."}],"title":"executeCommand(_:)","kind":"symbol","url":"\/documentation\/puremvc\/controller\/executecommand(_:)"},"doc://PureMVC/documentation/PureMVC/INotification":{"title":"INotification","abstract":[{"type":"text","text":"The interface definition for a PureMVC Notification."}],"role":"symbol","url":"\/documentation\/puremvc\/inotification","navigatorTitle":[{"text":"INotification","kind":"identifier"}],"type":"topic","kind":"symbol","identifier":"doc:\/\/PureMVC\/documentation\/PureMVC\/INotification","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"INotification","kind":"identifier"}]},"doc://PureMVC/documentation/PureMVC/Controller":{"url":"\/documentation\/puremvc\/controller","type":"topic","title":"Controller","kind":"symbol","role":"symbol","abstract":[{"type":"text","text":"A Multiton "},{"type":"codeVoice","code":"IController"},{"type":"text","text":" implementation."}],"identifier":"doc:\/\/PureMVC\/documentation\/PureMVC\/Controller","fragments":[{"text":"class","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Controller","kind":"identifier"}],"navigatorTitle":[{"text":"Controller","kind":"identifier"}]},"doc://PureMVC/documentation/PureMVC":{"abstract":[],"url":"\/documentation\/puremvc","kind":"symbol","type":"topic","title":"PureMVC","identifier":"doc:\/\/PureMVC\/documentation\/PureMVC","role":"collection"}}}
1+
{"abstract":[{"text":"If an ","type":"text"},{"type":"codeVoice","code":"ICommand"},{"text":" has previously been registered","type":"text"},{"text":" ","type":"text"},{"text":"to handle a the given ","type":"text"},{"type":"codeVoice","code":"INotification"},{"text":", then it is executed.","type":"text"}],"hierarchy":{"paths":[["doc:\/\/PureMVC\/documentation\/PureMVC","doc:\/\/PureMVC\/documentation\/PureMVC\/Controller"]]},"schemaVersion":{"major":0,"patch":0,"minor":3},"variants":[{"paths":["\/documentation\/puremvc\/controller\/executecommand(_:)"],"traits":[{"interfaceLanguage":"swift"}]}],"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"text":"executeCommand","kind":"identifier"},{"text":"(","kind":"text"},{"text":"_","kind":"externalParam"},{"text":" ","kind":"text"},{"text":"notification","kind":"internalParam"},{"text":": any ","kind":"text"},{"identifier":"doc:\/\/PureMVC\/documentation\/PureMVC\/INotification","text":"INotification","preciseIdentifier":"s:7PureMVC13INotificationP","kind":"typeIdentifier"},{"text":")","kind":"text"}]}]},{"kind":"parameters","parameters":[{"name":"notification","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"An "},{"type":"codeVoice","code":"INotification"}]}]}]}],"metadata":{"role":"symbol","title":"executeCommand(_:)","symbolKind":"method","modules":[{"name":"PureMVC"}],"roleHeading":"Instance Method","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"executeCommand","kind":"identifier"},{"text":"(any ","kind":"text"},{"text":"INotification","kind":"typeIdentifier","preciseIdentifier":"s:7PureMVC13INotificationP"},{"text":")","kind":"text"}],"externalID":"s:7PureMVC10ControllerC14executeCommandyyAA13INotification_pF"},"kind":"symbol","sections":[],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/PureMVC\/documentation\/PureMVC\/Controller\/executeCommand(_:)"},"references":{"doc://PureMVC/documentation/PureMVC/INotification":{"abstract":[{"type":"text","text":"The interface definition for a PureMVC Notification."}],"url":"\/documentation\/puremvc\/inotification","kind":"symbol","role":"symbol","fragments":[{"text":"protocol","kind":"keyword"},{"text":" ","kind":"text"},{"text":"INotification","kind":"identifier"}],"identifier":"doc:\/\/PureMVC\/documentation\/PureMVC\/INotification","title":"INotification","type":"topic","navigatorTitle":[{"text":"INotification","kind":"identifier"}]},"doc://PureMVC/documentation/PureMVC/Controller/executeCommand(_:)":{"title":"executeCommand(_:)","kind":"symbol","url":"\/documentation\/puremvc\/controller\/executecommand(_:)","type":"topic","identifier":"doc:\/\/PureMVC\/documentation\/PureMVC\/Controller\/executeCommand(_:)","abstract":[{"type":"text","text":"If an "},{"type":"codeVoice","code":"ICommand"},{"type":"text","text":" has previously been registered"},{"type":"text","text":" "},{"type":"text","text":"to handle a the given "},{"type":"codeVoice","code":"INotification"},{"type":"text","text":", then it is executed."}],"fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"executeCommand"},{"kind":"text","text":"(any "},{"preciseIdentifier":"s:7PureMVC13INotificationP","kind":"typeIdentifier","text":"INotification"},{"kind":"text","text":")"}],"role":"symbol"},"doc://PureMVC/documentation/PureMVC/Controller":{"url":"\/documentation\/puremvc\/controller","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"Controller"}],"abstract":[{"type":"text","text":"A Multiton "},{"code":"IController","type":"codeVoice"},{"type":"text","text":" implementation."}],"role":"symbol","type":"topic","identifier":"doc:\/\/PureMVC\/documentation\/PureMVC\/Controller","kind":"symbol","title":"Controller","navigatorTitle":[{"kind":"identifier","text":"Controller"}]},"doc://PureMVC/documentation/PureMVC":{"title":"PureMVC","url":"\/documentation\/puremvc","role":"collection","type":"topic","abstract":[],"kind":"symbol","identifier":"doc:\/\/PureMVC\/documentation\/PureMVC"}}}

0 commit comments

Comments
 (0)