diff --git a/TemplateApplication.xcodeproj/project.pbxproj b/TemplateApplication.xcodeproj/project.pbxproj index b95f227..bb036f2 100644 --- a/TemplateApplication.xcodeproj/project.pbxproj +++ b/TemplateApplication.xcodeproj/project.pbxproj @@ -700,6 +700,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UITemplateApplicationlicationSceneManifest_Generation = YES; INFOPLIST_KEY_UITemplateApplicationlicationSupportsIndirectInputEvents = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -726,6 +727,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 637867499T; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.stanford.spezi.templateapplication.tests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -743,6 +745,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 637867499T; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.stanford.spezi.templateapplicationuitests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -903,6 +906,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UITemplateApplicationlicationSceneManifest_Generation = YES; INFOPLIST_KEY_UITemplateApplicationlicationSupportsIndirectInputEvents = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -949,6 +953,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_UITemplateApplicationlicationSceneManifest_Generation = YES; INFOPLIST_KEY_UITemplateApplicationlicationSupportsIndirectInputEvents = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -976,6 +981,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 637867499T; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.stanford.spezi.templateapplication.tests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -994,6 +1000,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 637867499T; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.stanford.spezi.templateapplication.tests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1011,6 +1018,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 637867499T; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.stanford.spezi.templateapplicationuitests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1028,6 +1036,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 637867499T; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.stanford.spezi.templateapplicationuitests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1087,8 +1096,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/StanfordSpezi/SpeziScheduler.git"; requirement = { - kind = upToNextMinorVersion; - minimumVersion = 0.8.3; + branch = "feature/infinity-loop"; + kind = branch; }; }; 2F49B7742980407B00BCB272 /* XCRemoteSwiftPackageReference "Spezi" */ = { diff --git a/TemplateApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TemplateApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 493a021..69e7034 100644 --- a/TemplateApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/TemplateApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -60,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk.git", "state" : { - "revision" : "a5c253d1b4409eb8aef4346015ba000f9935cb2d", - "version" : "11.0.0" + "revision" : "9118aca998dbe2ceac45d64b21a91c6376928df7", + "version" : "11.1.0" } }, { @@ -69,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "ca30c987b732d130732fb60b071e0b655a85ada7", - "version" : "11.0.0" + "revision" : "07a2f57d147d2bf368a0d2dcb5579ff082d9e44f", + "version" : "11.1.0" } }, { @@ -186,8 +186,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/StanfordSpezi/Spezi", "state" : { - "revision" : "87d735b4db005b1ff825bb3b55733cb78a69f899", - "version" : "1.7.1" + "revision" : "77550134ea4cf7cd05314bc44ccb13f7495503fc", + "version" : "1.7.2" } }, { @@ -220,7 +220,7 @@ { "identity" : "spezifoundation", "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziFoundation.git", + "location" : "https://github.com/StanfordSpezi/SpeziFoundation", "state" : { "revision" : "d3a675735c734001e29e51689217d160bde51ce2", "version" : "2.0.0-beta.1" @@ -267,8 +267,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/StanfordSpezi/SpeziScheduler.git", "state" : { - "revision" : "896eb442eb2941f9b2f7721c3ac871373934142a", - "version" : "0.8.3" + "branch" : "feature/infinity-loop", + "revision" : "2b7c443cf30ab59511311df825b9795468963399" } }, { @@ -301,7 +301,7 @@ { "identity" : "swift-atomics", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-atomics", + "location" : "https://github.com/apple/swift-atomics.git", "state" : { "revision" : "cd142fd2f64be2100422d658e7411e39489da985", "version" : "1.2.0" @@ -393,8 +393,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/StanfordBDHG/XCTRuntimeAssertions", "state" : { - "revision" : "a2b127559cae78ae497273f047ccd99b28bf319b", - "version" : "1.1.2" + "revision" : "f560ec8410af032dd485ca9386e8c2b5d3e1a1f8", + "version" : "1.1.3" } }, { diff --git a/TemplateApplication/Schedule/EventContextView.swift b/TemplateApplication/Schedule/EventContextView.swift index efcbc96..6105812 100644 --- a/TemplateApplication/Schedule/EventContextView.swift +++ b/TemplateApplication/Schedule/EventContextView.swift @@ -15,7 +15,7 @@ struct EventContextView: View { var body: some View { - HStack { + HStack { // TODO: see if we can introduce the tile views from NAMS? => automatically make it a gird layout on iPad? VStack(alignment: .leading) { HStack { if eventContext.event.complete { diff --git a/TemplateApplication/Schedule/ScheduleView.swift b/TemplateApplication/Schedule/ScheduleView.swift index 9413cac..5b92800 100644 --- a/TemplateApplication/Schedule/ScheduleView.swift +++ b/TemplateApplication/Schedule/ScheduleView.swift @@ -20,8 +20,9 @@ struct ScheduleView: View { @State private var presentedContext: EventContext? @Binding private var presentingAccount: Bool - - + + @Environment(ILScheduler.self) private var ilScheduler + @MainActor private var eventContextsByDate: OrderedDictionary { let eventContexts = scheduler.tasks.flatMap { task in task @@ -33,18 +34,22 @@ struct ScheduleView: View { EventContext(event: event, task: task) } } - .sorted() + .sorted() // TODO: double sort! return OrderedDictionary(grouping: eventContexts) { eventContext in Calendar.current.startOfDay(for: eventContext.event.scheduledAt) } } + private var eventsToday: Any { + ilScheduler.queryEvents(for: .now.. { let dateComponents: DateComponents if FeatureFlags.testSchedule { @@ -38,6 +48,7 @@ extension TemplateApplicationScheduler { end: .numberOfEvents(365) ), notifications: true, + // TODO: we probably WANT to store the questionnaire along the task? to properly version it? Or just the identifier to make it easier to update? context: TemplateApplicationTaskContext.questionnaire(Bundle.main.questionnaire(withName: "SocialSupportQuestionnaire")) ) } diff --git a/TemplateApplication/TemplateApplicationDelegate.swift b/TemplateApplication/TemplateApplicationDelegate.swift index 631c5d3..82cf5e0 100644 --- a/TemplateApplication/TemplateApplicationDelegate.swift +++ b/TemplateApplication/TemplateApplicationDelegate.swift @@ -50,6 +50,7 @@ class TemplateApplicationDelegate: SpeziAppDelegate { } TemplateApplicationScheduler() + ILScheduler() OnboardingDataSource() } } diff --git a/TemplateApplication/TemplateApplicationStandard.swift b/TemplateApplication/TemplateApplicationStandard.swift index 4262d89..7546e9d 100644 --- a/TemplateApplication/TemplateApplicationStandard.swift +++ b/TemplateApplication/TemplateApplicationStandard.swift @@ -18,6 +18,7 @@ import SpeziFirestore import SpeziHealthKit import SpeziOnboarding import SpeziQuestionnaire +import SpeziScheduler import SwiftUI @@ -29,9 +30,14 @@ actor TemplateApplicationStandard: Standard, @Application(\.logger) private var logger @Dependency(FirebaseConfiguration.self) private var configuration + @Dependency(ILScheduler.self) private var scheduler init() {} + @MainActor func configure() { + + } + func add(sample: HKSample) async { if FeatureFlags.disableFirebase {