Skip to content

Commit

Permalink
4주차 과제 -수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim-jisoo11 committed May 12, 2021
1 parent a26ed41 commit bbe32c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
18 changes: 7 additions & 11 deletions First Assignment/First Assignment/Login/FirstViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FirstViewController: UIViewController {

}

//알림 보내기

func Alert(title: String) {
DispatchQueue.main.async {
let controller = UIAlertController(title: title, message: nil, preferredStyle: .alert)
Expand All @@ -34,9 +34,11 @@ class FirstViewController: UIViewController {
}


// 새로운 계정 만들기


@IBAction func MakeAccountButtonClicked(_ sender: Any) {

//request Alert 보내기

if self.emailTextField.hasText && self.PasswordTextField.hasText && self.PasswordCheckTextField.hasText {

Expand Down Expand Up @@ -72,6 +74,7 @@ class FirstViewController: UIViewController {

}
}
// signupAction

func signupAction()
{
Expand All @@ -84,7 +87,7 @@ class FirstViewController: UIViewController {
self.makeAlert(title: "알림",
message: message,
okAction: {_ in

// 회원가입 성공시 확인 누르면 탭바 화면으로 넘어가게 연결
let storyboard = UIStoryboard(name: "TabStoryboard", bundle: nil)
guard let mainVC =
storyboard.instantiateViewController(identifier: "MainTabBarController") as? MainTabBarController else {return}
Expand All @@ -102,13 +105,6 @@ class FirstViewController: UIViewController {
}

}
// 탭바 컨트롤러로 push 하기
// let storyboard = UIStoryboard(name: "TabStoryboard", bundle: nil)
//
// guard let mainVC = storyboard.instantiateViewController(identifier: "TabBarController") as? TabBarController
// else {return}
//
// self.navigationController?.pushViewController(mainVC, animated: true)




Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LoginViewController: UIViewController {
}

@IBAction func loginButtonClicked(_ sender: Any) {

// 로그인 알림 보내기
self.makeRequestAlert(title: "알림",
message: "로그인을 하시겠습니까?",
okAction: { _ in
Expand All @@ -28,7 +28,7 @@ class LoginViewController: UIViewController {


}

// loginAction
func loginAction()
{
LoginService.shared.login(email: self.emailTextField.text!, password: self.passwordTextField.text!) { result in
Expand All @@ -41,6 +41,7 @@ class LoginViewController: UIViewController {
self.makeAlert(title: "알림",
message: message,
okAction : { _ in
// 로그인 가능 시 확인 누르면 탭바 화면으로 연결
let storyboard = UIStoryboard(name: "TabStoryboard", bundle: nil)
guard let mainVC =
storyboard.instantiateViewController(identifier: "MainTabBarController") as? MainTabBarController else {return}
Expand All @@ -66,7 +67,7 @@ class LoginViewController: UIViewController {


@IBAction func signupButtonClicked(_ sender: Any) {
print("dd")

guard let nextVC = self.storyboard?.instantiateViewController(identifier:"FirstViewController")as? FirstViewController else {return}

self.navigationController?.pushViewController(nextVC, animated: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ enum NetworkResult<T> {
case serverErr
case networkFail
}
// 로그인 뷰컨 보여줄래?

0 comments on commit bbe32c4

Please sign in to comment.