This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Find top view controller | |
extension UIViewController { | |
func topViewController(_ base: UIViewController?, _ nonPresented: Bool = false) -> UIViewController? { | |
if let nav = base as? UINavigationController { | |
return topViewController(nav.visibleViewController, nonPresented) | |
} | |
if let tab = base as? UITabBarController { | |
if let selected = tab.selectedViewController { | |
return topViewController(selected, nonPresented) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
struct PCXhead { | |
var identity: UInt8 = 0 | |
var pcxver: UInt8 = 0 | |
var compression: UInt8 = 0 | |
var bpp: UInt8 = 0 | |
var minX: UInt16 = 0 | |
var minY: UInt16 = 0 |