Skip to content

Instantly share code, notes, and snippets.

Mariano Abdala marianoabdala

Block or report user

Report or block marianoabdala

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
marianoabdala / UIViewController+SafeAreaLayoutGuide.swift
Created Apr 16, 2018 — forked from fedetrim/UIViewController+SafeAreaLayoutGuide.swift
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"

Keybase proof

I hereby claim:

  • I am marianoabdala on github.
  • I am marianoabdala ( on keybase.
  • I have a public key whose fingerprint is 0CA2 71D2 DA79 21E0 5483 A477 23D6 68AB 1A5A AB48

To claim this, I am signing this object:

- (void)saveScreenshotToDocumentsDirectory
CGSize imageSize = [[UIScreen mainScreen] bounds].size;
if (NULL != UIGraphicsBeginImageContextWithOptions)
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);
else UIGraphicsBeginImageContext(imageSize);
CGContextRef context = UIGraphicsGetCurrentContext();
for (UIWindow *window in [[UIApplication sharedApplication] windows]) {
if (![window respondsToSelector:@selector(screen)] || [window screen] == [UIScreen mainScreen]) {
You can’t perform that action at this time.