Description
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.
NxEnabled alternatives and similar libraries
Based on the "Button" category.
Alternatively, view NxEnabled alternatives based on common mentions on social networks and blogs.
-
LGButton
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code. -
PMSuperButton
๐ฅ PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! ๐ -
AHDownloadButton
Customizable download button with progress and transition animations. It is based on Apple's App Store download button. -
NFDownloadButton
Revamped Download Button. It's kinda a reverse engineering of Netflix's app download button. -
SimpleButton
Simple UIButton subclass with additional state change animations (e.g. backgroundColor) and missing features -
DesignableButton
A Custom UIButton with Centralised Styling and common styles available in Interface Builder -
AnimatablePlayButton
Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation. -
IGStoryButtonKit
IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of NxEnabled or a related project?
README
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 :rocket:
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
protocolBe a successor from
NSObject
Not forget about
dynamic
label for propertyDone.
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. :clap:
Installation :fire:
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 :muscle:
Nikita Ermolenko, [email protected]
License :exclamation:
NxEnabled is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the NxEnabled README section above
are relevant to that project's source code only.