TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Oct 2017 |
SwiftSwift Version | 4.0 |
SPMSupports SPM | ✗ |
Maintained by Taiki Suzuki.
You can handle safeAreaInsets changes of every UIView.
final class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.safeArea.insetsDidChange = { insets in
// If safeAreaInsets of `self.view`, this closure called.
print("view.safeAreaInsets = \(insets)")
}
}
}
extension UIView {
// UIView Extension about Safe Area
var safeArea: SafeAreaExtension { get }
}
class SafeAreaExtension {
// Safe Area Insets handler
var insetsDidChange: ((UIEdgeInsets) -> ())? { get set }
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
marty-suzuki, [email protected]
SafeAreaExtension is available under the MIT license. See the LICENSE file for more info.