let type: ActivityType = .DogMood func carePlanActivity() -> OCKCarePlanActivity { // define early starting date let startDate = NSDateComponents(year: 2016, month: 1, day: 1) // set weekly scheduling let schedule = OCKCareSchedule.weeklyScheduleWithStartDate( startDate, occurrencesOnEachDay: [1, 1, 1, 1, 1, 1, 1] ) // set details for this activity let title = "Mood" // generate activity return OCKCarePlanActivity.assessmentWithIdentifier( type.rawValue, groupIdentifier: nil, title: title, text: nil, tintColor: Colors.Green.color, resultResettable: false, schedule: schedule, userInfo: nil ) } // set task func task() -> ORKTask { let question = NSLocalizedString("On a scale from 1 to 10, how would you rate your dog mood today?", comment: "") let maximumValueDescription = NSLocalizedString("Good", comment: "") let minimumValueDescription = NSLocalizedString("Bad", comment: "") let answerFormat = ORKScaleAnswerFormat( maximumValue: 10, minimumValue: 1, defaultValue: -1, step: 1, vertical: false, maximumValueDescription: maximumValueDescription, minimumValueDescription: minimumValueDescription ) let questionStep = ORKQuestionStep(identifier: type.rawValue, title: question, answer: answerFormat) questionStep.optional = false let task = ORKOrderedTask(identifier: type.rawValue, steps: [questionStep]) return task } }