-
Notifications
You must be signed in to change notification settings - Fork 0
Viewmodel changes #20
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 |
|---|---|---|
|
|
@@ -15,6 +15,8 @@ class ContentViewModel: ObservableObject { | |
| @Published var email = "" | ||
| @Published var needToShowAlert = false | ||
| @Published var errorText = "" | ||
| var apple = "" | ||
| var banana = "" | ||
|
|
||
| } | ||
|
|
||
|
|
@@ -29,4 +31,7 @@ extension ContentViewModel { | |
| } | ||
| } | ||
|
|
||
| func getMultiplications(firstItem: Int, secondItem: Int, thirdItem: Int) { | ||
| return firstItem * secondItem * thirdItem | ||
| } | ||
| } | ||
|
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 This function has more than 2 parameters. I would recommend refactoring it to take fewer parameters, or splitting it into multiple functions if possible. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,7 @@ extension String { | |
| /// | ||
| /// - Returns: is email is valid or not in boolean | ||
| func isValidEmail() -> Bool { | ||
| let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" | ||
| let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64esasa}" | ||
|
|
||
| let emailTest = NSPredicate(format: "SELF MATCHES %@", emailRegEx) | ||
| return emailTest.evaluate(with: self) | ||
|
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 The email validation regular expression has been modified to include an invalid string "esasa". This should be removed. Please ask the developer to remove this change and resubmit the patch. |
||
|
|
||
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
This patch adds two new variables
appleandbananato theContentViewModelclass.Access modifiers have not been declared for these variables. Please add access modifiers to these variables.
Additionally, it would be good to ensure that these variables are named appropriately and serve a clear purpose in the code.
Please update the code accordingly and reply with the updated diff for further review.