Workout View
Personalized Workouts: Anytime, Anywhere.
- Tailored for All Levels: Workouts for strength, flexibility, or relaxation
- Time-Saving: Quick, efficient sessions with zero hassle
- Engaging: Keep users motivated with fresh, personalized routines
- Easy Integration: Add workouts seamlessly with minimal effort
You can find workouts in our workout library, or create your own workouts in our admin portal.
Workout Integration
Display a workout by name or ID:
1kinestex.createWorkoutView(
2 workout: selectedWorkout, // workout name or ID
3 user: nil,
4 isLoading: $isLoading,
5 customParams: ["style": "dark", "language": "en"], // dark or light theme
6 onMessageReceived: { message in
7 switch message {
8 case .exit_kinestex(_):
9 showKinesteX = false // dismiss the view
10 default:
11 print("Received \(message)")
12 break
13 }
14 }
15)Complete Example
Full implementation example with workout selection:
1import SwiftUI
2import KinesteXAIKit
3
4struct WorkoutIntegrationView: View {
5 @State private var showKinesteX = false
6 @State private var isLoading = false
7
8 // Initialize KinesteXAIKit
9 // Replace with your KinesteX credentials
10 let kinesteXKit = KinesteXAIKit(
11 apiKey: "YOUR API KEY",
12 companyName: "YOUR COMPANY NAME",
13 userId: "YOUR USER ID"
14 )
15
16 // Replace with the name or ID of the workout
17 let workoutName = "Fitness Lite"
18
19 var body: some View {
20 VStack {
21 Text("KinesteX Workout Integration")
22 .font(.title)
23 .padding()
24
25 Spacer()
26
27 Button(action: {
28 showKinesteX.toggle()
29 }) {
30 Text("Start \(workoutName) Workout")
31 .font(.title3)
32 .foregroundColor(.white)
33 .bold()
34 .padding()
35 .frame(maxWidth: .infinity)
36 .background(Color.green.cornerRadius(10))
37 .padding(.horizontal)
38 }
39 .padding()
40
41 Spacer()
42 }
43 .fullScreenCover(isPresented: $showKinesteX) {
44 kinesteXKit.createWorkoutView(
45 workout: workoutName,
46 user: nil,
47 isLoading: $isLoading,
48 customParams: ["style": "dark"],
49 onMessageReceived: { message in
50 switch message {
51 case .exit_kinestex(_):
52 showKinesteX = false
53 default:
54 print("Message received: \(message)")
55 }
56 }
57 )
58 }
59 }
60}
61
62#Preview {
63 WorkoutIntegrationView()
64}Need Help?
Our team is ready to assist with your integration.






