Latest 0.0.1
Homepage https://github.com/muizidn/eventclosure
License MIT
Platforms ios 9.0
Authors

Event Closure

Make your event #selector to be a closure. Beautiful!

Build Status
codecov
GitHub top language
Cocoapods

Avoid

control.addTarget(self, action: #selector(fetchGithubUsers), for: .touchUpInside)

Do

control.onTouchUpInside { fetchGithubUsers() }

Get Your Own Control

let showConfirmAction = control.onTouchUpInside {
    showConfirmationAlert("Close connection?") { 
        connection.close()
    }
}

To Invoke It

showConfirmAction.performAction()

But its not recommended

Or To Remove It Later

control.rmOnTouchUpInside(
  showConfirmationAction
)

CocoaPod

pod "EventClosure"

Latest podspec

{
    "name": "EventClosure",
    "version": "0.0.1",
    "summary": "A closure way to handle UIControl.Event",
    "description": "Make your UIControl.Event handling #selector to be a closure",
    "homepage": "https://github.com/muizidn/eventclosure",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Muhammad Muizzsuddin": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.2",
    "source": {
        "git": "https://github.com/muizidn/eventclosure.git",
        "tag": "0.0.1"
    },
    "source_files": "EventClosure/**/*.{h,m,swift}"
}

Pin It on Pinterest

Share This