diff --git a/iOSTestApp/iOSTestApp/ContentViewModel.swift b/iOSTestApp/iOSTestApp/ContentViewModel.swift index 2e95aff..4c50314 100644 --- a/iOSTestApp/iOSTestApp/ContentViewModel.swift +++ b/iOSTestApp/iOSTestApp/ContentViewModel.swift @@ -15,7 +15,9 @@ class ContentViewModel: ObservableObject { @Published var email = "" @Published var needToShowAlert = false @Published var errorText = "" - + private var totalCount: Int? + var Price = 10 + private var no_of_vehicles = 22 } // MARK: - Save data @@ -29,4 +31,8 @@ extension ContentViewModel { } } + func GetTotalPrice() -> Int { + let result = Price * (no_of_vehicles + totalCount!) + return result + } }