Skip to content

Instantly share code, notes, and snippets.

Avatar

Federico Trimboli fedetrim

View GitHub Profile
@fedetrim
fedetrim / UIViewController+SafeAreaLayoutGuide.swift
Last active Apr 16, 2018
Backwards compatible Safe Area Layout Guide API for iOS 10 and iOS 9
View UIViewController+SafeAreaLayoutGuide.swift
import UIKit
extension UIViewController {
var ft_safeAreaLayoutGuide: UILayoutGuide {
if #available(iOS 11.0, *) {
return view.safeAreaLayoutGuide
} else {
let id = "ft_safeAreaLayoutGuide"