-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT][#7] 출석체크 코드 입력에 따라 출석버튼 Enabled 변경
- Optional+Extension 추가 : isNil, isNotNil, isEmptyOrNil - textField 입력될 때 마다 버튼 enabled 체크 - 버튼 enabled 값에 따라 configuration 변경
- Loading branch information
Showing
4 changed files
with
106 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Optional+Extension.swift | ||
// momoIOS | ||
// | ||
// Created by 임수현 on 2023/02/11. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Optional { | ||
var isNil: Bool { | ||
self == nil | ||
} | ||
var isNotNil: Bool { | ||
self != nil | ||
} | ||
} | ||
|
||
extension String? { | ||
var isEmptyOrNil: Bool { | ||
self?.isEmpty == true || self.isNil | ||
} | ||
} |
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,21 @@ | ||
// | ||
// UINavigationController+Extension.swift | ||
// momoIOS | ||
// | ||
// Created by 임수현 on 2023/02/11. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UINavigationController: ObservableObject, UIGestureRecognizerDelegate { | ||
override open func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
// backButton을 임의로 변경하면 swipe back 동작이 되지 않기 떄문에 gestureRecognizer를 설정하여 동작하도록 함. | ||
interactivePopGestureRecognizer?.delegate = self | ||
} | ||
|
||
public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { | ||
return viewControllers.count > 1 | ||
} | ||
} |
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