Skip to content

Commit ad52da2

Browse files
committed
[ORKStepNavigationRule] Improve documentation
- Improve whitespace - Specify that passing 'ORKNullStepIdentifier' (instead of 'nil') ends the task for direct and predicate step navigation rules.
1 parent 5492740 commit ad52da2

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

ResearchKit/Common/ORKStepNavigationRule.h

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ ORK_CLASS_AVAILABLE
6565
/*
6666
The `init` and `new` methods are unavailable.
6767
68-
`ORKStepNavigationRule` classes should be initialized with custom designated initializers on each subclass.
68+
`ORKStepNavigationRule` classes should be initialized with custom designated initializers on each
69+
subclass.
6970
*/
7071
+ (instancetype)new NS_UNAVAILABLE;
7172
- (instancetype)init NS_UNAVAILABLE;
@@ -87,18 +88,20 @@ ORK_CLASS_AVAILABLE
8788

8889

8990
/**
90-
The `ORKPredicateStepNavigationRule` can be used to match any answer combination in the results of the ongoing task (or in those of
91-
previously completed tasks) and jump accordingly. You must provide one or more result predicates
92-
(each predicate can match one or more step results within the task).
91+
The `ORKPredicateStepNavigationRule` can be used to match any answer combination in the results of
92+
the ongoing task (or in those of previously completed tasks) and jump accordingly. You must provide
93+
one or more result predicates (each predicate can match one or more step results within the task).
9394
9495
Predicate step navigation rules contain an arbitrary number of result predicates with a
95-
corresponding number of destination step identifiers, plus an optional default step identifier that is
96-
used if none of the result predicates match. One result predicate can match one or more question
97-
results; if matching several question results, that predicate can belong to the same or to different task
98-
results). This rule allows you to define arbitrarily complex task navigation behaviors.
96+
corresponding number of destination step identifiers, plus an optional default step identifier that
97+
is used if none of the result predicates match. One result predicate can match one or more question
98+
results; if matching several question results, that predicate can belong to the same or to
99+
different task results). This rule allows you to define arbitrarily complex task navigation
100+
behaviors.
99101
100102
The `ORKResultPredicate` class provides convenience class methods to build predicates for all the
101-
`ORKQuestionResult` subtypes. Predicates must supply both the task result identifier and the question result identifier, in addition to one or more expected answers.
103+
`ORKQuestionResult` subtypes. Predicates must supply both the task result identifier and the
104+
question result identifier, in addition to one or more expected answers.
102105
*/
103106
ORK_CLASS_AVAILABLE
104107
@interface ORKPredicateStepNavigationRule : ORKStepNavigationRule
@@ -112,12 +115,14 @@ ORK_CLASS_AVAILABLE
112115
in any of the additional task results.
113116
@param destinationStepIdentifiers An array of possible destination step identifiers. This array
114117
must contain one step identifier for each of the predicates
115-
in the result predicates parameters.
118+
in the result predicates parameters. If you want for a
119+
certain predicate match to end te task, you achieve that by
120+
using the `ORKNullStepIdentifier` constant.
116121
@param defaultStepIdentifier The identifier of the step, which is used if none of the
117122
result predicates match. If this argument is `nil` and none
118123
of the predicates match, the default ordered task navigation
119-
behavior takes place (that is, the task goes to the next step in
120-
order).
124+
behavior takes place (that is, the task goes to the next
125+
step in order).
121126
122127
@return An initialized predicate step navigation rule.
123128
*/
@@ -142,7 +147,8 @@ ORK_CLASS_AVAILABLE
142147
destinationStepIdentifiers:(NSArray<NSString *> *)destinationStepIdentifiers NS_SWIFT_UNAVAILABLE("Use the Swift init(resultPredicatesAndDestinationStepIdentifiers: [(NSPredicate, String)], defaultStepIdentifierOrNil: String?) initializer instead.");
143148

144149
/**
145-
Returns a new predicate step navigation rule that was initialized from data in the given unarchiver.
150+
Returns a new predicate step navigation rule that was initialized from data in the given
151+
unarchiver.
146152
147153
@param aDecoder The coder from which to initialize the step navigation rule.
148154
@@ -153,15 +159,15 @@ ORK_CLASS_AVAILABLE
153159
/**
154160
An optional array of additional task results.
155161
156-
With this property, a task can have different navigation behavior depending on the results of related
157-
tasks that the user may have already completed. The predicate step navigation rule can use the
158-
question results within these tasks, in addition to the current task question results, to match the
159-
result predicates.
162+
With this property, a task can have different navigation behavior depending on the results of
163+
related tasks that the user may have already completed. The predicate step navigation rule can use
164+
the question results within these tasks, in addition to the current task question results, to match
165+
the result predicates.
160166
161167
You must ensure that all the task result identifiers are unique and that they are different from
162168
the ongoing task result identifier. Also ensure that no task result contains question
163-
results with duplicate identifiers. Question results *can have* equal identifiers provided that they
164-
belong to different task results.
169+
results with duplicate identifiers. Question results *can have* equal identifiers provided that
170+
they belong to different task results.
165171
166172
Each object in the array should be of the `ORKTaskResult` class.
167173
*/
@@ -170,8 +176,8 @@ ORK_CLASS_AVAILABLE
170176
/**
171177
The array of result predicates.
172178
173-
@discussion This property contains one result predicate for each of the step identifiers
174-
in the `destinationStepIdentifiers` property.
179+
@discussion This property contains one result predicate for each of the step identifiers in the
180+
`destinationStepIdentifiers` property.
175181
*/
176182
@property (nonatomic, copy, readonly) NSArray<NSPredicate *> *resultPredicates;
177183

@@ -190,17 +196,19 @@ ORK_CLASS_AVAILABLE
190196

191197

192198
/**
193-
The `ORKDirectStepNavigationRule` class can be used to unconditionally jump to a destination step specified by its identifier or to finish the task early.
199+
The `ORKDirectStepNavigationRule` class can be used to unconditionally jump to a destination step
200+
specified by its identifier or to finish the task early.
194201
*/
195202
ORK_CLASS_AVAILABLE
196203
@interface ORKDirectStepNavigationRule : ORKStepNavigationRule
197204

198205
/**
199206
Returns an initialized direct-step navigation rule using the specified destination step identifier.
200207
201-
@param destinationStepIdentifier The identifier of the destination step. Pass `nil` if you want
202-
to finish the ongoing task when the direct-step navigation
203-
rule is triggered.
208+
@param destinationStepIdentifier The identifier of the destination step. Pass the
209+
`ORKNullStepIdentifier` constant if you want to finish the
210+
ongoing task when the direct-step navigation rule is
211+
triggered.
204212
205213
@return A direct-step navigation rule.
206214
*/

0 commit comments

Comments
 (0)