Skip to content

Commit a5bb677

Browse files
committed
Add cross reference.
1 parent 198f13c commit a5bb677

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

TSPL.docc/LanguageGuide/Protocols.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -898,17 +898,14 @@ the `play()` method above, and are called when
898898
a new game starts, a new turn begins, or the game ends.
899899

900900
Because the `delegate` property is an *optional* `DiceGame.Delegate`,
901-
the `play()` method uses optional chaining each time it calls a method on the delegate.
901+
the `play()` method uses optional chaining each time it calls a method on the delegate,
902+
as discussed in <doc:OptionalChaining>.
902903
If the `delegate` property is nil,
903904
these delegate calls fail gracefully and without error.
904905
If the `delegate` property is non-nil,
905906
the delegate methods are called,
906907
and are passed the `DiceGame` instance as a parameter.
907908

908-
<!--
909-
TODO: add a cross-reference to optional chaining here.
910-
-->
911-
912909
This next example shows a class called `DiceGameTracker`,
913910
which adopts the `DiceGame.Delegate` protocol:
914911

0 commit comments

Comments
 (0)