-
Notifications
You must be signed in to change notification settings - Fork 0
Added basic function. #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,8 +13,11 @@ class ContentViewModel: ObservableObject { | |
| @Published private var firstName = "" | ||
| @Published var lastName = "" | ||
| @Published var email = "" | ||
| @Published var elephantCount = 20 | ||
| @Published var contactVisible = 10 | ||
| @Published var needToShowAlert = false | ||
| @Published var errorText = "" | ||
| @Published var xv = 10 | ||
|
|
||
| } | ||
|
|
||
|
|
@@ -30,3 +33,37 @@ extension ContentViewModel { | |
| } | ||
|
|
||
| } | ||
|
|
||
| extension ContentViewModel { | ||
|
|
||
| func getContactVisibleCount() -> Int { | ||
| return contactVisible | ||
| } | ||
|
|
||
| func getElephantCount() -> Int{ | ||
| return elephantCount | ||
| } | ||
|
|
||
| struct UserData { | ||
| var firstName: String | ||
| var lastName: String | ||
| var email: String | ||
| var errorText: String | ||
| var xv: Int | ||
| } | ||
|
|
||
| func saveUserData(_ userData: UserData) { | ||
| debugPrint(firstName) | ||
| debugPrint(lastName) | ||
| } | ||
|
|
||
| func CheckForSwitch(date: String) { | ||
| switch date { | ||
| case "Hello": | ||
| break | ||
| default: | ||
| break | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 OpenAI In the In the In the Here's an updated version of the patch with these changes: @@ -30,3 +33,29 @@ extension ContentViewModel {
}
}
+extension ContentViewModel {
+
+ func getContactVisibleCount() -> Int {
+ return contactVisible
+ }
+
+ func getElephantCount() -> Int{
+ return elephantCount
+ }
+
+ struct UserData {
+ var firstName: String
+ var lastName: String
+ var email: String
+ var errorText: String
+ var xv: Int
+ }
+
+ func saveUserData(_ userData: UserData) {
+ debugPrint(userData.firstName)
+ debugPrint(userData.lastName)
+ }
+
+ func CheckForSwitch(date: String) {
+ // TODO: Add logic here
+ }
+
+}Please let me know if you have any questions or concerns.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @openai Apart from this anything else I need to change ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 OpenAI @purvesh-d Based on my review, these are the only changes that I recommend. However, it's always a good practice to thoroughly test the changes before merging them into the main branch. Let me know if you have any other questions or concerns.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @openai updated the code. Can you please recheck for the changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 OpenAI @purvesh-d Sure, I can recheck the changes. Please provide me with the updated code so that I can review it again. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 OpenAI
The patch adds two new published variables
Elephentandxvzabc. The variable names are not meaningful and do not follow the naming conventions. Please rename them to more meaningful names that follow the guidelines mentioned earlier.Also, please ensure that the access modifiers are added to these variables.
class ContentViewModel: ObservableObject { @Published private var firstName = "" @Published var lastName = "" @Published var email = "" + @Published private var elephantCount = 20 + @Published var contactVisible = 10 @Published var needToShowAlert = false @Published var errorText = "" }Please review the changes and let me know if you have any questions or concerns.