Skip to content

UIKevent is a helper that allows you to set an inline closure as a event handler to most ui controllers

License

Notifications You must be signed in to change notification settings

saulogt/UIKevent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UIKevent

[![CI Status](http://img.shields.io/travis/Saulo Tauil/UIKevent.svg?style=flat)](https://travis-ci.org/Saulo Tauil/UIKevent) Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8

Installation

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

pod "UIKevent"

Usage

The controls supported are

  • UIBarButtonItem
  • UIButton
  • UISegmentedControl
  • UIStepper
  • UISlider
  • UISwitch
  • UIDatePicker

It is still required to import UIKevent. I recomend doing thins only in the AppDelegate.swift

import UIKevent
barButton.onClick {_ in
    print("BarButtonItem Clicked");
};

button.onClick { (btn) in
    print("Button clicked");
}

switchControl.onChange(handler: { ctrl in
    print("UISwitch changed");

})

slider.onChange { (sld) in
    print("slider change to \(sld.value)");
}

stepper.onChange { (obj) in
    print("stepper change to \(obj.value)");
}

segControll.onChange { (obj) in
    print("seg change to \(obj.selectedSegmentIndex)");
}

Author

Saulo Tauil

License

UIKevent is available under the MIT license. See the LICENSE file for more info.

About

UIKevent is a helper that allows you to set an inline closure as a event handler to most ui controllers

Resources

License

Stars

Watchers

Forks

Packages

No packages published