Skip to content

Commit

Permalink
[#142] notch 유무로 기기대응용 함수 extension 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
meenyweeny committed Aug 12, 2022
1 parent 4bf3500 commit 0003e87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Deartoday/Deartoday/Global/Extension/UIViewController+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import UIKit

import SnapKit

// MARK: - Data 가져오기 기능

extension UIViewController {
Expand Down Expand Up @@ -65,4 +67,9 @@ extension UIViewController {
func setBackSwipeGesture() {
navigationController?.interactivePopGestureRecognizer?.delegate = nil
}

///Constraint 설정 시 노치 유무로 기기를 대응하는 상황에서 사용
func constraintByNotch(_ hasNotch: Int, _ noNotch: Int) -> ConstraintOffsetTarget {
return UIScreen.main.hasNotch ? hasNotch : noNotch
}
}

0 comments on commit 0003e87

Please sign in to comment.