All Projects → ActionKit → Actionkit

ActionKit / Actionkit

Licence: mit
Easy, closure-based Swift methods for working with interactive UIKit elements.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Actionkit

Actionclosurable
Extensions which helps to convert objc-style target/action to swifty closures
Stars: ✭ 120 (-52.94%)
Mutual labels:  carthage, closure, selector
country-region-dropdown-menu
A dropdown menu created with javascript that allows user to implement country-region dropdown list effortlessly.
Stars: ✭ 41 (-83.92%)
Mutual labels:  selector
SwiftyAcknowledgements
Integrate acknowledgements into your iOS App
Stars: ✭ 40 (-84.31%)
Mutual labels:  carthage
Hippolyte
HTTP Stubbing in Swift
Stars: ✭ 109 (-57.25%)
Mutual labels:  carthage
clevertap-ios-sdk
CleverTap iOS SDK
Stars: ✭ 39 (-84.71%)
Mutual labels:  carthage
Swash
Fonts in iOS made safe, expressive, and dynamic.
Stars: ✭ 73 (-71.37%)
Mutual labels:  carthage
BetterMappable
Better Mappable through Property Wrappers using ObjectMapper
Stars: ✭ 26 (-89.8%)
Mutual labels:  carthage
Swiftytexttable
A lightweight library for generating text tables.
Stars: ✭ 252 (-1.18%)
Mutual labels:  carthage
swift-currency
Type-safety and algorithms for working with money in Swift.
Stars: ✭ 88 (-65.49%)
Mutual labels:  carthage
VisualDebugger
The most elegant and easiest way to visual you data in playground
Stars: ✭ 22 (-91.37%)
Mutual labels:  carthage
macro
Customize code using closures
Stars: ✭ 135 (-47.06%)
Mutual labels:  closure
HTTPDNS-OC
HTTPDNS 库 Objdctive-C 实现(使用DNSPod 、AliyunDNS、 Google ...)
Stars: ✭ 33 (-87.06%)
Mutual labels:  carthage
NBBottomSheet
An iOS library that presents a bottom sheet using Auto Layout.
Stars: ✭ 60 (-76.47%)
Mutual labels:  carthage
PXDToolkit
A collection of Swift utility extensions and functions
Stars: ✭ 14 (-94.51%)
Mutual labels:  carthage
TTInputVisibilityController
Lightweight controller to keep your inputs visible when the keyboard is presented.
Stars: ✭ 21 (-91.76%)
Mutual labels:  carthage
BubbleShowCase-iOS
ShowCase is a framework that provides with a view that you can display to help your users understand your App features
Stars: ✭ 36 (-85.88%)
Mutual labels:  carthage
Process
A POSIX compliant library to run external applications in Swift.
Stars: ✭ 14 (-94.51%)
Mutual labels:  carthage
EllipticCurve
An elliptic curve library written in Swift 4
Stars: ✭ 18 (-92.94%)
Mutual labels:  carthage
Datez
📆 Breeze through Date, DateComponents, and TimeInterval with Swift!
Stars: ✭ 254 (-0.39%)
Mutual labels:  carthage
gito
⚡ git helper tool to clone/open/auto-install/edit with a one-liner
Stars: ✭ 26 (-89.8%)
Mutual labels:  carthage

Banner Version Carthage License Platform Swift

ActionKit

ActionKit is a light-weight, easy to use framework that wraps the target-action design paradigm into a less verbose, cleaner format. It shortens target-action method calls by removing the target and replacing the selector with a closure.

Example of target-action without ActionKit

button.addTarget(self, action: #selector(MyViewController.buttonWasTapped(_:)), forControlEvents: .TouchUpInside)

and somewhere else...

func buttonWasTapped(sender: Any) {
  if let button = sender as? UIButton {
    button.setTitle("Button was tapped!", forState: .Normal)
  } 
}

Or with ActionKit, all in one place

button.addControlEvent(.touchUpInside) { (control: UIControl) in
  guard let button = control as? UIButton else {
    return
  }
  button.setTitle("Button was tapped!", forState: .Normal)

}

Installation

CocoaPods

ActionKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ActionKit', '~> 2.5.2'

Carthage

    1. Add the following to your Cartfile:
    github "ActionKit/ActionKit" == 2.5.2

How it works

ActionKit extends target-action functionality by providing easy to use methods that take closures instead of a selector. ActionKit uses a singleton which stores the closures and acts as the target. Closures capture and store references to any constants and variables from their context, so the user is free to use variables from the context in which the closure was defined in.

Features

  • Add an action based closure to any UIGestureRecognizer subclass (eg. UITapGestureRecognizer, UIPanGestureRecognizer...) instead of needing to use the target-action mechanism
  • Remove actions added to UIGestureRecognizer subclasses
  • Add an action based closure to any UIControl subclass (eg: UIButton, UIView, UISwitch...) instead of needing to use the target-action mechanism
  • For UIControls, add an action for any number of controlEvents
  • Remove actions added to UIControl subclasses
  • Add an action based closure to any UIBarButtonItem, instead of needing target-action
  • Remove actions added to UIBarButtonItems

Examples

See the examples wiki

Changelog

See the changelog here

License

Licensed under the terms of the MIT license. See LICENSE file

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].