Skip to content

Commit 8237d09

Browse files
committed
Opened necessary methods for overriding
Annoying Library-use issues in Swift. Methods which must be overridden or invoked from inheriting classes, where the base comes from a Library, must be marked `open` as `internal` become frustratingly inaccessible.
1 parent 0f2de69 commit 8237d09

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Sources/EventDrivenSwift/EventDispatcher/EventDispatcher.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ open class EventDispatcher: EventHandler, EventDispatching {
8282
- Author: Simon J. Stuart
8383
- Version: 1.0.0
8484
*/
85-
override internal func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
85+
override open func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
8686
let eventTypeName = String(reflecting: type(of: event))
8787

8888
var snapReceivers = [String:[ReceiverContainer]]()

Sources/EventDrivenSwift/EventHandler/EventHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ open class EventHandler: ObservableThread, EventHandling {
100100
- Parameters:
101101
- event: The Event to Process.
102102
*/
103-
internal func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
103+
open func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
104104
preconditionFailure("processEvent must be overriden!")
105105
}
106106

Sources/EventDrivenSwift/EventListener/EventListener.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ open class EventListener: EventHandler, EventListenable {
4747
- dispatchMethod: The Means by which the Event was Dispatched
4848
- priority: The Priority given to the Event at the point of Dispatch
4949
*/
50-
override internal func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
50+
override open func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
5151
let eventTypeName = String(reflecting: type(of: event))
5252
var listeners: [EventListenerContainer]? = nil
5353

Sources/EventDrivenSwift/EventPool/EventPool.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ open class EventPool<TEventThread: EventThreadable>: EventHandler, EventPooling
100100
//TODO: Implement Scaling + Culling here
101101
}
102102

103-
override internal func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
103+
override open func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
104104
let eventTypeName = String(reflecting: type(of: event))
105105

106106
var snapPools = [String:[ThreadContainer]]()

Sources/EventDrivenSwift/EventThread/EventThread.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ open class EventThread: EventReceiver, EventThreadable {
3232
- Author: Simon J. Stuart
3333
- Version: 4.0.0
3434
*/
35-
override internal func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
35+
override open func processEvent(_ event: any Eventable, dispatchMethod: EventDispatchMethod, priority: EventPriority) {
3636
let eventTypeName = String(reflecting: type(of: event))
3737
var callback: EventCallback? = nil
3838

@@ -53,7 +53,7 @@ open class EventThread: EventReceiver, EventThreadable {
5353
- callback: The code to invoke for the given `Eventable` Type
5454
- forEventType: The `Eventable` Type for which to Register the Callback
5555
*/
56-
internal func addEventCallback<TEvent: Eventable>(_ callback: @escaping TypedEventCallback<TEvent>, forEventType: Eventable.Type) {
56+
open func addEventCallback<TEvent: Eventable>(_ callback: @escaping TypedEventCallback<TEvent>, forEventType: Eventable.Type) {
5757
let eventTypeName = String(reflecting: forEventType)
5858

5959
_eventCallbacks.withLock { eventCallbacks in
@@ -76,7 +76,7 @@ open class EventThread: EventReceiver, EventThreadable {
7676
- forEvent: The instance of the `Eventable` type to be processed
7777
- priority: The `EventPriority` with which the `forEvent` was dispatched
7878
*/
79-
internal func callTypedEventCallback<TEvent: Eventable>(_ callback: @escaping TypedEventCallback<TEvent>, forEvent: Eventable, priority: EventPriority) {
79+
open func callTypedEventCallback<TEvent: Eventable>(_ callback: @escaping TypedEventCallback<TEvent>, forEvent: Eventable, priority: EventPriority) {
8080
if let typedEvent = forEvent as? TEvent {
8181
callback(typedEvent, priority)
8282
}
@@ -89,7 +89,7 @@ open class EventThread: EventReceiver, EventThreadable {
8989
- Parameters:
9090
- forEventType: The `Eventable` Type for which to Remove the Callback
9191
*/
92-
internal func removeEventCallback(forEventType: any Eventable) {
92+
open func removeEventCallback(forEventType: any Eventable) {
9393
let eventTypeName = String(reflecting: forEventType)
9494

9595
_eventCallbacks.withLock { eventCallbacks in
@@ -106,7 +106,7 @@ open class EventThread: EventReceiver, EventThreadable {
106106
- Author: Simon J. Stuart
107107
- Version: 4.0.0
108108
*/
109-
internal func registerEventListeners() {
109+
open func registerEventListeners() {
110110
// No default implementation
111111
}
112112

Sources/EventDrivenSwift/UIEventThread/UIEventThread.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ open class UIEventThread: EventThread, UIEventThreadable {
2525
}
2626
}
2727

28-
override internal func callTypedEventCallback<TEvent: Eventable>(_ callback: @escaping TypedEventCallback<TEvent>, forEvent: Eventable, priority: EventPriority) {
28+
override open func callTypedEventCallback<TEvent: Eventable>(_ callback: @escaping TypedEventCallback<TEvent>, forEvent: Eventable, priority: EventPriority) {
2929
Task { /// Have to use a Task because this method is not `async`
3030
await MainActor.run { /// Forces the call to be invoked on the `MainActor` (UI Thread)
3131
super.callTypedEventCallback(callback, forEvent: forEvent, priority: priority)

0 commit comments

Comments
 (0)