Skip to content

Instantly share code, notes, and snippets.

View felipericieri's full-sized avatar
:octocat:
Coding

Felipe Ricieri felipericieri

:octocat:
Coding
View GitHub Profile
@felipericieri
felipericieri / AdditionalWindowToHideSensitiveData.swift
Last active July 11, 2020 23:44
Using Additional Window to hide sensitive data
@UIApplicationMain
class AppDelegate: UIApplicationDelegate {
var window: UIWindow?
private lazy var backgroundWindow: UIWindow = {
let screen = UIScreen.main
let window = UIWindow(frame: screen.bounds)
window.screen = screen
window.rootViewController = BlockViewController()
@felipericieri
felipericieri / ChangeWindowRootViewController.swift
Last active January 18, 2020 22:41
Change Window Root View Controller
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
// MARK: - Handling Application Background State
func applicationDidEnterBackground(_ application: UIApplication) {
@felipericieri
felipericieri / AddBlockViewAsWindowSubview.swift
Last active January 18, 2020 22:40
Adds a Block View as Window Subview
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
// MARK: - Handling Application Background State
func applicationDidEnterBackground(_ application: UIApplication) {
@felipericieri
felipericieri / AddBlockViewToWindowRootViewControllerView.swift
Last active January 18, 2020 22:39
Adds a Block View to Window Root View Controller
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
// MARK: - Handling Application Background State
func applicationDidEnterBackground(_ application: UIApplication) {
@felipericieri
felipericieri / ScrollingController.swift
Created August 6, 2019 09:52
A `UIViewController` with a `UIScrollView` embeded that acts like a View Container
import UIKit
/// Objects conforming with `ScrollingAdditionalViewController` need to share its preferred height in stack
public protocol ScrollingAdditionalViewController where Self: UIViewController {
var preferredHeightInStack: CGFloat { get }
}
/// `NestedScrollViewController` represents the nested `UIScrollView` in `ScrollingController`
public protocol NestedScrollViewController where Self: UIViewController {
var view: UIView! { get }