File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -898,17 +898,14 @@ the `play()` method above, and are called when
898
898
a new game starts, a new turn begins, or the game ends.
899
899
900
900
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 > .
902
903
If the ` delegate ` property is nil,
903
904
these delegate calls fail gracefully and without error.
904
905
If the ` delegate ` property is non-nil,
905
906
the delegate methods are called,
906
907
and are passed the ` DiceGame ` instance as a parameter.
907
908
908
- <!--
909
- TODO: add a cross-reference to optional chaining here.
910
- -->
911
-
912
909
This next example shows a class called ` DiceGameTracker ` ,
913
910
which adopts the ` DiceGame.Delegate ` protocol:
914
911
You can’t perform that action at this time.
0 commit comments