Skip to content

Commit 0003e87

Browse files
committed
[#142] notch 유무로 기기대응용 함수 extension 추가
1 parent 4bf3500 commit 0003e87

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Deartoday/Deartoday/Global/Extension/UIViewController+.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
import UIKit
99

10+
import SnapKit
11+
1012
// MARK: - Data 가져오기 기능
1113

1214
extension UIViewController {
@@ -65,4 +67,9 @@ extension UIViewController {
6567
func setBackSwipeGesture() {
6668
navigationController?.interactivePopGestureRecognizer?.delegate = nil
6769
}
70+
71+
///Constraint 설정 시 노치 유무로 기기를 대응하는 상황에서 사용
72+
func constraintByNotch(_ hasNotch: Int, _ noNotch: Int) -> ConstraintOffsetTarget {
73+
return UIScreen.main.hasNotch ? hasNotch : noNotch
74+
}
6875
}

0 commit comments

Comments
 (0)