Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Support

Appreciate the small things.

DebugPanel

Implementation

MainViewController.swift

override func viewDidLoad() {
    super.viewDidLoad()        
    #if !RELEASE
    becomeFirstResponder()
    #endif
}
    
#if !RELEASE
override var canBecomeFirstResponder: Bool {
    return true
}

override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
    if motion == .motionShake {
        DebugPanel.instance.present(in: self)
    }
}
#endif

Usage

func add(key: String, value: @escaping (@escaping (String?) -> Void) -> Void)

func addButton(title: String, action: @escaping (() -> Void))

Log Handler

logger = Logger(label: Bundle.main.bundleIdentifier!) { [unowned self] label -> LogHandler in
    var handlers: [LogHandler] = [ ]
    
    #if !RELEASE
    handlers.append(DebugPanelLogHandler())
    #endif
    
    return MultiplexLogHandler(handlers)
}