Suggestions and Meal Plans

Suggestions

The SDK provides the ability to fetch a predefined set of suggested foods for logging, depending on the current time of day

public enum PassioMealTime: String, Codable {
    case breakfast
    case lunch
    case dinner
    case snack
}

public func fetchSuggestions(mealTime: PassioMealTime,  completion: @escaping ([PassioFoodDataInfo]) -> Void)

Example of fetching suggestions for snack meal time:

banana, coffee, black tea, coke, cheddar cheese, chocolate chip cookies, potato chips, blueberry muffin, plain yogurt, strawberries, ...

Quick suggestion UI example

Meal Plans

Meal Plans provide users suggestions which foods to consume depending on their dietary preference and time of day. The Meal Plan api is divided into two functions:

  • fetchMealPlans that is used to retrieve all of the possible meal plans. These meal plans usually correlate with a specific diet like "Keto Diet".

  • fetchMealPlanForDay is an api that is used to fetch specific foods recommended for a certain day of a target meal plan.

public func fetchMealPlans(completion: @escaping ([PassioMealPlan]) -> Void)

public func fetchMealPlanForDay(mealPlanLabel: String,
                                day: Int,
                                completion: @escaping ([PassioMealPlanItem]) -> Void)

public struct PassioMealPlan: Codable, Equatable {
    public var mealPlanLabel: String?
    public var mealPlanTitle: String?
    public var carbsTarget: Int?
    public var proteinTarget: Int?
    public var fatTarget: Int?
}

public struct PassioMealPlanItem {
    public var dayNumber: Int?
    public var dayTitle: String?
    public var mealTime: PassioMealTime?
    public var meal: PassioFoodDataInfo?
}

Some of the available meal plans:

Heart Healthy Diet, Ketogenic Diet, Managing Obesity, Managing Type 2 Diabetes, Low FODMAP, Healthy Kidney Diet, Balanced Diet, DASH Diet, PCOS Diet, Mediterranean Diet

Example of meal plan UI

Last updated