mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-14 17:49:08 +08:00
33 lines
550 B
Swift
33 lines
550 B
Swift
//
|
|
// UIView+iOS11.swift
|
|
// MessageViewController
|
|
//
|
|
// Created by Ryan Nystrom on 12/22/17.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
internal extension UIView {
|
|
|
|
var util_safeAreaInsets: UIEdgeInsets {
|
|
if #available(iOS 11.0, *) {
|
|
return safeAreaInsets
|
|
} else {
|
|
return .zero
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
internal extension UIScrollView {
|
|
|
|
var util_adjustedContentInset: UIEdgeInsets {
|
|
if #available(iOS 11.0, *) {
|
|
return adjustedContentInset
|
|
} else {
|
|
return contentInset
|
|
}
|
|
}
|
|
|
|
}
|