passforios/passKit/Extensions/UIViewExtension.swift

29 lines
656 B
Swift
Raw Permalink Normal View History

//
// UIViewExtension.swift
// passKit
//
// Created by Yishi Lin on 2018/4/11.
// Copyright © 2018 Yishi Lin. All rights reserved.
//
import Foundation
extension UIView {
// Save anchors: https://stackoverflow.com/questions/46317061/use-safe-area-layout-programmatically
var safeTopAnchor: NSLayoutYAxisAnchor {
safeAreaLayoutGuide.topAnchor
}
2018-12-09 16:59:07 -08:00
var safeLeftAnchor: NSLayoutXAxisAnchor {
safeAreaLayoutGuide.leftAnchor
}
2018-12-09 16:59:07 -08:00
var safeRightAnchor: NSLayoutXAxisAnchor {
safeAreaLayoutGuide.rightAnchor
}
2018-12-09 16:59:07 -08:00
var safeBottomAnchor: NSLayoutYAxisAnchor {
safeAreaLayoutGuide.bottomAnchor
}
}