0
當我點擊同意按鈕時,它應該去AgreeCompletionStep,但它去同意不同意步驟。請任何人都可以指出是什麼問題?我有問題,ORKResultPredicate的predicateForConsent函數
let consentTask = ORKNavigableOrderedTask(identifier: String(describing:Identifier.consentTask), steps: [reviewConsentStep, disAgreeStep, completionStep])
resultSelector = ORKResultSelector(
resultIdentifier: String(
describing: Identifier.consentReviewStep))
let predicateAgree = ORKResultPredicate.predicateForConsent(
with: resultSelector, didConsent: true)
let agreePredicateRule = ORKPredicateStepNavigationRule(
resultPredicatesAndDestinationStepIdentifiers: [
(predicateAgree,
String(describing: Identifier.consentCompletionStep))])
consentTask.setNavigationRule(
agreePredicateRule,
forTriggerStepIdentifier:String(
describing:Identifier.consentReviewStep))
let consentDirectRule = ORKDirectStepNavigationRule(
destinationStepIdentifier: ORKNullStepIdentifier)
consentTask.setNavigationRule(
consentDirectRule,
forTriggerStepIdentifier:String(
describing:Identifier.consentDisagreeStep))
則可以反向添加'Rule'這個命令和檢查。 –
所以我將predicateRule上面的directRule移動了,但它不起作用。 – iarpits