I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 48877079 authored by meeh's avatar meeh
Browse files

OSX Launcher: Log all events for debugging

parent e68182a1
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
import Foundation import Foundation
// TODO: Log all events?
class EventManager { class EventManager {
var listeners = Dictionary<String, NSMutableArray>(); var listeners = Dictionary<String, NSMutableArray>();
...@@ -51,6 +53,7 @@ class EventManager { ...@@ -51,6 +53,7 @@ class EventManager {
// @param eventName: Matching listener eventNames will fire when this is called // @param eventName: Matching listener eventNames will fire when this is called
// @param information: pass values to your listeners // @param information: pass values to your listeners
func trigger(eventName:String, information:Any? = nil) { func trigger(eventName:String, information:Any? = nil) {
print("Event: ", eventName, " will trigger ", self.listeners[eventName]?.count ?? 0, " listeners")
if let actionObjects = self.listeners[eventName] { if let actionObjects = self.listeners[eventName] {
for actionObject in actionObjects { for actionObject in actionObjects {
if let actionToPerform = actionObject as? EventListenerAction { if let actionToPerform = actionObject as? EventListenerAction {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment