Skip to content

Commit

Permalink
add properties for UIViewController extension
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSteven committed Nov 2, 2023
1 parent 23a4b09 commit 65e3df8
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,17 @@ private class ViewControllerLifecycleObserver:UIViewController,Observer {
didMove(toParent: parent)
}
}
class LoginViewController:UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
public extension UIViewController {
var safeTopAnchor:NSLayoutYAxisAnchor {
return view.safeAreaLayoutGuide.topAnchor
}
var safeBottomAnchor:NSLayoutYAxisAnchor {
return view.safeAreaLayoutGuide.bottomAnchor
}
var safeTrailingAnchor:NSLayoutXAxisAnchor {
return view.safeAreaLayoutGuide.trailingAnchor
}
var safeAreaInsets:UIEdgeInsets {
return view.safeAreaInsets
}

}

0 comments on commit 65e3df8

Please sign in to comment.