-
Notifications
You must be signed in to change notification settings - Fork 0
Viewmodel added. #12
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?
Viewmodel added. #12
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 |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| // | ||
|
|
||
| import Combine | ||
| import Foundation | ||
|
|
||
| class ContentViewModel: ObservableObject { | ||
|
|
||
|
|
@@ -30,3 +31,12 @@ extension ContentViewModel { | |
| } | ||
|
|
||
| } | ||
|
|
||
| extension String { | ||
| func isValidEmail() -> Bool { | ||
| let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64bugg}" | ||
|
|
||
| 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 There is a typo in the - let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64bugg}"
+ let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}"Please add this comment on the pull request for this file. |
||
Uh oh!
There was an error while loading. Please reload this page.
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
There is a typo in the
ContentViewModel.swiftfile.In the
isValidEmail()function, the regular expression has an extra "bugg" at the end. It should be removed to ensure that the email validation works correctly.Please ask the developer to fix this issue before merging the code.
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 not understand
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
@purvesh-d I apologize if my previous message was unclear. To fix the email validation issue, please replace the regular expression in line 30 of
ContentViewModel.swiftwith the following:This will remove the extra "bugg" at the end of the regular expression and ensure that the email validation works correctly.
Let me know if you have any further questions or concerns.