diff --git a/.swiftpm/xcode/package.xcworkspace/xcuserdata/vico.xcuserdatad/UserInterfaceState.xcuserstate b/.swiftpm/xcode/package.xcworkspace/xcuserdata/vico.xcuserdatad/UserInterfaceState.xcuserstate index 155519f..3ce8608 100644 Binary files a/.swiftpm/xcode/package.xcworkspace/xcuserdata/vico.xcuserdatad/UserInterfaceState.xcuserstate and b/.swiftpm/xcode/package.xcworkspace/xcuserdata/vico.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Sources/COFFEE/Views/SurveyView/SurveyView.swift b/Sources/COFFEE/Views/SurveyView/SurveyView.swift index d4a3ced..7da16c9 100644 --- a/Sources/COFFEE/Views/SurveyView/SurveyView.swift +++ b/Sources/COFFEE/Views/SurveyView/SurveyView.swift @@ -13,7 +13,11 @@ import SwiftUI public struct SurveyView: View { // View model for this survey session, also provided to the subviews as environment object - @StateObject public var viewModel: ViewModel + @StateObject var viewModel: ViewModel + + public init(viewModel: SurveyView.ViewModel) { + self.viewModel = viewModel + } public var body: some View { VStack(alignment: .leading, spacing: 6) { @@ -101,7 +105,7 @@ extension SurveyView { /// - survey: The survey to display /// - completionHandler: A function that is called when the survey is completed /// - showSurvey: A binding to a boolean value that defines whether the survey view is shown or not - init(survey: Survey, completionHandler: ((Submission) -> ())?, showSurvey: Binding) { + public init(survey: Survey, completionHandler: ((Submission) -> ())?, showSurvey: Binding) { // Make sure survey is not empty // Ensure the survey is not empty assert(!survey.items.isEmpty, "Survey is empty. The survey should have at least one item.")