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

Overview

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.

You might also like...
Elegant SwiftUI phone number textField.
Elegant SwiftUI phone number textField.

iPhoneNumberField ☎️ Format phone numbers as they're typed—entirely in SwiftUI. 📱 Get Started | Examples | Customize | Features | Install | And it's

An optional TextField Replacement for SwiftUI
An optional TextField Replacement for SwiftUI

TextInputView A TextField Replacement In his excellent YouTube tutorial series on Building SwiftUI Components, Peter Friese (@peterfriese on Twitter)

This is the demo repository for having floating TextField in swift UI

ed-floating-field-swiftui This is the demo repository for having floating TextField in swift UI The inputs fields should not be empty Validations for

TextField with DropDown support using UIPickerView
TextField with DropDown support using UIPickerView

IQDropDownTextField TextField with DropDown support using UIPickerView Installing Install using cocoapods. Add in your Podfile: pod 'IQDropDownTextFie

TextField with smart suggestion
TextField with smart suggestion

AutoCompleteTextField Features Provides a subclass of UITextField that has suggestion from input Has autocomplete input feature Data suggestion are pr

Awesome TextField is a nice and simple libriary for iOS and Mac OSX
Awesome TextField is a nice and simple libriary for iOS and Mac OSX

Awesome TextField is a nice and simple libriary for iOS and Mac OSX. It's highly customisable and easy-to-use tool. Works perfectly for any registration or login forms in your app.

Apple TextField created according to the Material.IO guidelines of 2019. Featured at Medium.
Apple TextField created according to the Material.IO guidelines of 2019. Featured at Medium.

CocoaTextField Highly customizable text field created according to Material.IO guidelines. Minimum iOS version 11.0 Carthage github "edgar-zigis/Cocoa

TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes
TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes

TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes

🔍 RAMReel is a UI controller that allows you to choose options from a list.
🔍 RAMReel is a UI controller that allows you to choose options from a list.

REEL SEARCH Reel Search is a Swift UI controller that allows you to choose options from a list We specialize in the designing and coding of custom UI

Comments
  • Swift 4

    Swift 4

    Refactor project for new swift 4 feature: class & protocol. Waiting for bug fixing (https://bugs.swift.org/browse/SR-3849) and add new KVO mechanism.

    enhancement 
    opened by Otbivnoe 0
Releases(1.1.1)
Owner
Nikita Ermolenko
iOS evangelist | lover of music, bikes and photography | ex-Yandex
Nikita Ermolenko
Floating-textfield-swiftui - Floating textfield With SwiftUI

floating_textfield-swiftui Hey, Guys welcome to this tutorial. In this complete

null 1 Feb 11, 2022
Provides a SwiftUI multi-line TextView implementation including support for auto-sizing. (iOS)

TextView Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+ Provides a SwiftUI multi-line TextView implementation with supp

SwiftUI+ 51 Jan 3, 2023
Flutter plugin to display VGS card info using TextView or View

VGS Card Info Flutter plugin to display VGS Card info using TextView or View Installation Add the dependency in your pubspec.yaml vgscardinfo: git

Djamo Côte d'Ivoire 0 Mar 7, 2022
A TextView that provides easy to use tagging feature for Mention or Hashtag

Tagging A TextView that provides easy to use tagging feature for Mention or Hashtag. Introduction Tagging is a UIView that encloses a TextView that co

DongHee Kang 109 Dec 5, 2022
DTTextField is a custom textfield with floating placeholder and error label

DTTextField Introduction DTTextField is a UITextField library with floating placeholder and error label. Floating placeholder inspired from JVFloatLab

Dhaval Thanki 310 Jan 5, 2023
Floating Label TextField for SwiftUI. FloatingLabelTextFieldSwiftUI

FloatingLabelTextFieldSwiftUI FloatingLabelTextFieldSwiftUI is a small and lightweight SwiftUI framework written in completely swiftUI (not using UIVi

Kishan Raja 337 Jan 2, 2023
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies

PasswordTextField A custom TextField with a switchable icon which shows or hides the password and enforces good password policies, written in Swift. ⭐

Chris Jimenez 304 Dec 29, 2022
A SwiftUI TextField with a prompt (or placeholder) that floats above the text field when active or not empty. Requires iOS 15.

FloatingPromptTextField A prompt is the label in a text field that informs the user about the kind of content the text field expects. In a default Tex

Emilio Peláez 43 Nov 3, 2022
A floating label style for SwiftUI's TextField.

FloatingLabelTextFieldStyle A floating label style for TextField with support for displaying error messages. Requirements iOS 15.0+ macOS 12.0+ Instal

Red Davis 13 Aug 22, 2022
Simple placeholder move textfield

PlaceholderTextField Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 11.0 o

null 6 Mar 9, 2022