2018-09-20

Simple Events in Swift

Events are useful when you need more than one delegate or event handler. Here is a simple class that can be used to manage events:




Use the uiSubscribe and uiUnsubscribe to have the Event class automatically run the event handler on the main DispatchQueue (for GUI related stuff). Here is an example of how to use them:

No comments:

Restart Xcode Playground

If your playground ever crashes and/or gets stuck try switching the playground type in the File Inspector (right panel) to a different Platf...