-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚗️ (ContentKitExample): List sample activities, show details
- Loading branch information
Showing
3 changed files
with
80 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
Modules/ContentKit/Examples/ContentKitExample/Sources/ActivityListView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import ContentKit | ||
import MarkdownUI | ||
import SwiftUI | ||
|
||
// MARK: - ActivityListView | ||
|
||
struct ActivityListView: View { | ||
let activities: [Activity] = ContentKit.listSampleActivities() ?? [] | ||
|
||
var body: some View { | ||
List { | ||
ForEach(self.activities) { activity in | ||
NavigationLink(destination: ActivityDetailsView(activity: activity)) { | ||
Text(activity.name) | ||
} | ||
} | ||
} | ||
.navigationTitle("Activities") | ||
.onAppear { | ||
let skills = Skills.list | ||
for (index, skill) in skills.enumerated() { | ||
print("skill \(index + 1)") | ||
print("id: \(skill.id)") | ||
print("name: \(skill.name)") | ||
print("description: \(skill.description)") | ||
} | ||
|
||
let hmis = HMI.list | ||
for (index, hmi) in hmis.enumerated() { | ||
print("hmi \(index + 1)") | ||
print("id: \(hmi.id)") | ||
print("name: \(hmi.name)") | ||
print("description: \(hmi.description)") | ||
} | ||
|
||
let authors = Authors.list | ||
for (index, author) in authors.enumerated() { | ||
print("author \(index + 1)") | ||
print("id: \(author.id)") | ||
print("name: \(author.name)") | ||
print("description: \(author.description)") | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
NavigationStack { | ||
ActivityListView() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters