<commit_before># SwiftEvents
Coming from actionscript 3 i have decided to integrate event system into swift. Since swift does not support function pointers, it was required to change the passing also the object self.

Extend the EventDispatcher into your dispatching classes. Also you can implement the IEventDispatcherProtocol into any classes for example any views that cannot extend the EventDispatcher.

Usage : 

	1. Adding events listeners to internal handlers
       
	view1.addEventListener("someEvent1", withFunction: view1.handler1)
        view1.addEventListener("someEvent2", withFunction: view1.handler2)
        view2.addEventListener("someEvent2", withFunction: view2.handler2)
        
        2. View1 will not be interested in any events after this line
        view1.removeAllListeners()
        
	3. Triggering events
        view1.dispatchEvent(Event(type: "someEvent1")) // won't trigger anything
        view1.dispatchEvent(Event(type: "someEvent2")) // executes handler 2 in view2
        
        4. We can use the global dispatcher
        EventHub.instance.trigger(Event(type :"someEvent2")); // executes handler 2 in view2
        
	5. Removing just one event type from the listening
        view2.removeEventListener("someEvent2")
        
        6. Using the global dispatcher again ( just to check if we have removed it )
        EventHub.instance.trigger(Event(type :"someEvent2")); // silence, no one is interested in that event
        
        7. Custom events (supporting custom data)
        view2.addEventListener(CustomEvent.CUSTOM_TYPE, withFunction: customEventHandler)
        
        var customEvent : CustomEvent = CustomEvent(attribute: "someCustomType")
        EventHub.instance.trigger(customEvent)
<commit_msg>ready update<commit_after># SwiftEvents
Coming from actionscript 3 i have decided to integrate event system into swift. Since swift does not support function pointers, it was required to change the passing also the object self.

Extend the EventDispatcher into your dispatching classes. Also you can implement the IEventDispatcherProtocol into any classes for example any views that cannot extend the EventDispatcher.

Usage : 

	1. Adding events listeners to internal handlers
       
	view1.addEventListener("someEvent1", withFunction: view1.handler1)
        view1.addEventListener("someEvent2", withFunction: view1.handler2)
        view2.addEventListener("someEvent2", withFunction: view2.handler2)
        
        2. View1 will not be interested in any events after this line
        view1.removeAllListeners()
        
	3. Triggering events
        view1.dispatchEvent(Event(type: "someEvent1")) // won't trigger anything
        view1.dispatchEvent(Event(type: "someEvent2")) // executes handler 2 in view2
        
        4. We can use the global dispatcher
        EventHub.instance.trigger(Event(type :"someEvent2")); // executes handler 2 in view2
        
	5. Removing just one event type from the listening
        view2.removeEventListener("someEvent2")
        
        6. Using the global dispatcher again ( just to check if we have removed it )
        EventHub.instance.trigger(Event(type :"someEvent2")); // silence, no one is interested in that event
        
        7. Custom events (supporting custom data)
        view2.addEventListener(CustomEvent.CUSTOM_TYPE, withFunction: customEventHandler)
        
        var customEvent : CustomEvent = CustomEvent(attribute: "someCustomType")
        EventHub.instance.trigger(customEvent)
	
	8. Added listening trough a global event listener, if you are too lazy to inherit/implement the dispatcher. 	However use this only for testing since its a bad practice.

	// too lazy to extend the EventDispatcher ?
        EventHub.instance.addEventListener("some_generic_event", withFunction: test)
        EventHub.instance.trigger(Event(type: "some_generic_event")) // --> outerListener
        EventHub.instance.removeEventListener("some_generic_event")
        EventHub.instance.trigger(Event(type: "some_generic_event")) // --> silence


{'fraction_non_alphanumeric': 0.06933857880501598, 'fraction_numerical': 0.017457585443816082, 'mean_word_length': 3.350802139037433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2692288', 'n_tokens_mistral': 1028, 'n_tokens_neox': 993, 'n_words': 379}