Skip to content

Instantly share code, notes, and snippets.

@maxcampolo
maxcampolo / GlobalConstant.swift
Created August 10, 2016 14:58
Global constants with swift extensions and Implicit Member Expression.
extension Double {
public static let kRectX = 30.0
public static let kRectY = 30.0
public static let kRectWidth = 30.0
public static let kRectHeight = 30.0
}
public func makeRect() -> CGRect {
return CGRect(x: .kRectX, y: .kRectY, width: .kRectWidth, height: .kRectHeight)
}
@AvatarHurden
AvatarHurden / AppDelegate.swift
Last active August 13, 2018 02:37
Coordinator with navigation and service functions
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let window = UIWindow(frame: UIScreen.main.bounds)
self.window = window