-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f15ab3d
commit 955eb2d
Showing
3 changed files
with
124 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
KNU_CSE/KNU_CSE/Main Tab/MyPage/EditPw/EditPwViewModel+Model.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// EditPwViewModel.swift | ||
// KNU_CSE | ||
// | ||
// Created by junseok on 2021/08/06. | ||
// | ||
|
||
import Foundation | ||
|
||
class EditPwViewModel { | ||
typealias Listener = (EditPwModel) -> Void | ||
var listener: Listener? | ||
var account: EditPwModel = EditPwModel(email: "", changePassword: "", changePassword2: "", currentPassword:"") | ||
var emailCode:String! | ||
|
||
init(listener : Listener?){ | ||
self.listener = listener | ||
} | ||
|
||
func bind(listener: Listener?) { | ||
self.listener = listener | ||
} | ||
|
||
func SignUpCheck()-> Bool{ | ||
return account.Check() | ||
} | ||
} | ||
|
||
class EditPwModel: BaseObject{ | ||
var email:String | ||
var changePassword:String | ||
var changePassword2:String | ||
var currentPassword:String | ||
|
||
init(email : String, changePassword : String, changePassword2 : String, currentPassword : String){ | ||
self.email = email | ||
self.changePassword = changePassword | ||
self.changePassword2 = changePassword2 | ||
self.currentPassword = currentPassword | ||
super.init() | ||
} | ||
|
||
required init(from decoder: Decoder) throws { | ||
fatalError("init(from:) has not been implemented") | ||
} | ||
|
||
func Check() -> Bool{ | ||
if self.changePassword != "" && self.changePassword2 != "" && self.currentPassword != "" && self.changePassword == self.changePassword2{ | ||
return true | ||
}else{ | ||
return false | ||
} | ||
} | ||
} |