Aller au contenu principal

Training Module

The Training module provides all training-related UI screens and functionality.

Accessing the module

After connect, use sdk.modules.training (e.g. AzeooSDK.shared.modules.training).

Methods

showMainScreen

Shows the main training screen with an overview of all training features.

func showMainScreen()

Example:

training?.showMainScreen()

showWorkoutPlans

Shows the workout plans screen where users can browse available workout plans.

func showWorkoutPlans()

Example:

training?.showWorkoutPlans()

showWorkoutPlan

Shows a specific workout plan.

func showWorkoutPlan(_ planId: String)

Parameters:

  • planId (String): The ID of the workout plan to display.

Example:

training?.showWorkoutPlan("plan-123")

showExercises

Shows the exercises screen where users can browse the exercise library.

func showExercises()

Example:

training?.showExercises()

showExercise

Shows a specific exercise.

func showExercise(_ exerciseId: String)

Parameters:

  • exerciseId (String): The ID of the exercise to display.

Example:

training?.showExercise("exercise-456")

showProgress

Shows the progress screen where users can track their fitness progress.

func showProgress()

Example:

training?.showProgress()

showSchedule

Shows the schedule screen where users can manage their workout schedule.

func showSchedule()

Example:

training?.showSchedule()

Complete Example

import UIKit
import AzeooSDK

class TrainingViewController: UIViewController {
@IBOutlet weak var mainScreenButton: UIButton!
@IBOutlet weak var workoutPlansButton: UIButton!
@IBOutlet weak var exercisesButton: UIButton!
@IBOutlet weak var progressButton: UIButton!
@IBOutlet weak var scheduleButton: UIButton!

override func viewDidLoad() {
super.viewDidLoad()
setupButtons()
}

private func setupButtons() {
mainScreenButton.addTarget(self, action: #selector(showMainScreen), for: .touchUpInside)
workoutPlansButton.addTarget(self, action: #selector(showWorkoutPlans), for: .touchUpInside)
exercisesButton.addTarget(self, action: #selector(showExercises), for: .touchUpInside)
progressButton.addTarget(self, action: #selector(showProgress), for: .touchUpInside)
scheduleButton.addTarget(self, action: #selector(showSchedule), for: .touchUpInside)
}

@objc private func showMainScreen() {
AzeooUI.instance?.training.showMainScreen()
}

@objc private func showWorkoutPlans() {
AzeooUI.instance?.training.showWorkoutPlans()
}

@objc private func showExercises() {
AzeooUI.instance?.training.showExercises()
}

@objc private func showProgress() {
AzeooUI.instance?.training.showProgress()
}

@objc private func showSchedule() {
AzeooUI.instance?.training.showSchedule()
}
}

Next Steps