All Projects → Otbivnoe → Nxenabled

Otbivnoe / Nxenabled

Licence: mit
Library that allows you binding `enabled` property of button with textable elements (TextView, TextField)

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Nxenabled

PickerButton
PickerButton is subclass of UIButton that presents UIPickerView in UIKeyboard.
Stars: ✭ 41 (+24.24%)
Mutual labels:  uibutton
Ssspinnerbutton
Forget about typical stereotypic loading, It's time to change. SSSpinnerButton is an elegant button with a diffrent spinner animations.
Stars: ✭ 357 (+981.82%)
Mutual labels:  uibutton
Pmsuperbutton
🔥 PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! 😎
Stars: ✭ 653 (+1878.79%)
Mutual labels:  uibutton
ALRadioButtons
RadioButtons for iOS. Inherited from UIControl, support 2 native styles, fully customizable.
Stars: ✭ 65 (+96.97%)
Mutual labels:  uibutton
TezButton
TezButton is include Title/Backgound Color, border, corner radius options and Bottom/Left label, Include data button.
Stars: ✭ 20 (-39.39%)
Mutual labels:  uibutton
Ppcounter
iOS与macOS中一款优雅的数字/金额增减动效组件
Stars: ✭ 451 (+1266.67%)
Mutual labels:  uibutton
Jztvosparallaxbutton
📺 tvOS Button with Parallax Effect (ObjC)
Stars: ✭ 161 (+387.88%)
Mutual labels:  uibutton
Wobbingbutton
Where UIButton is not enough
Stars: ✭ 20 (-39.39%)
Mutual labels:  uibutton
Selector-Closure
A light way to convert objc target-action style to closure
Stars: ✭ 14 (-57.58%)
Mutual labels:  uibutton
Haptica
Easy Haptic Feedback Generator 📳
Stars: ✭ 587 (+1678.79%)
Mutual labels:  uibutton
AnimatedButton
UIButton subclass which performs animation on selection
Stars: ✭ 16 (-51.52%)
Mutual labels:  uibutton
RTIconButton
A Interface Builder configurable UIButton with a image icon
Stars: ✭ 40 (+21.21%)
Mutual labels:  uibutton
Swiftybutton
Simple and customizable button in Swift
Stars: ✭ 471 (+1327.27%)
Mutual labels:  uibutton
RCPickerButton
Simple button for marking some items as selected.
Stars: ✭ 17 (-48.48%)
Mutual labels:  uibutton
Loaderbutton
LoaderButton is a very interesting animation loading button.
Stars: ✭ 19 (-42.42%)
Mutual labels:  uibutton
Lgbutton
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.
Stars: ✭ 2,216 (+6615.15%)
Mutual labels:  uibutton
Jzmultichoicescirclebutton
🔘 Multi choice circle button with cool 3d parallax effect, but seriously don't use this in production now, I will rewrite it to a delegate based UIControl when I am available.
Stars: ✭ 380 (+1051.52%)
Mutual labels:  uibutton
Aaviewanimator
AAViewAnimator is a set of animations designed for UIView, UIButton, UIImageView with options in iOS, written in Swift.
Stars: ✭ 33 (+0%)
Mutual labels:  uibutton
Dlradiobutton
Radio Button for iOS
Stars: ✭ 872 (+2542.42%)
Mutual labels:  uibutton
Buttonprogressbar Ios
A small and flexible (well documented) UIButton subclass with animated loading progress, and completion animation.
Stars: ✭ 479 (+1351.52%)
Mutual labels:  uibutton

NxEnabled

Build Status Carthage compatible CocoaPods compatible Swift 3.0.x platforms

What is NxEnabled?

It's a fairly common case, when the enabled state of button depends on some textable elements such as TextView, TextField. So this library allows the simplest way to achive this purpose with only few lines of code.

Getting started 🚀

Typical login screen with short, beautiful validation code:

loginButton.isEnabled(by: usernameTextField, passwordTextField) { username, password in
    username.characters.count > 5 && password.characters.count > 5
}

you can also combine together UITextView with UITextField's:

signUpButton.isEnabled(by: firstnameTextField, lastnameTextField, bioTextView) { firstname, lastname, bio in
    return /* validation value */
}

So there is also oportunity to add not UI element:

  • Implement Textable protocol

  • Be a successor from NSObject

  • Not forget about dynamic label for property

  • Done.

class Object: NSObject, Textable {
    dynamic var value: String?
    var textKey: String {
        return "value"
    }
}

NOTE:

One important case is that you should clear button's bag. It removes all observers from textable elements. Usually it needs to do in deinit method.

deinit {
    signUpButton.clearBag()
}

Now library allows to add textable elements up to six. 👏

Installation 🔥

CocoaPods

To integrate NxEnabled, simply add the following line to your Podfile:

pod "NxEnabled"

Carthage

To integrate NxEnabled into your Xcode project using Carthage, specify it in your Cartfile:

github "Otbivnoe/NxEnabled"

Run carthage update to build the framework and drag the built NxEnabled.framework into your Xcode project.

Author 💪

Nikita Ermolenko, [email protected]

License ❗️

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

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].