From 63309f3f68d937ed34be79d3c32f956136937d6a Mon Sep 17 00:00:00 2001 From: Purvesh Dodiya Date: Tue, 4 Apr 2023 00:54:40 +0530 Subject: [PATCH] Added force casting and naming issues --- iOSTestApp/iOSTestApp/ContentViewModel.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 + } }