{"id":2956,"url":"https://github.com/Otbivnoe/NxEnabled","last_synced_at":"2025-08-03T12:31:50.870Z","repository":{"id":62449194,"uuid":"78723198","full_name":"Otbivnoe/NxEnabled","owner":"Otbivnoe","description":"Library that allows you binding `enabled` property of button with textable elements (TextView, TextField)","archived":true,"fork":false,"pushed_at":"2017-10-04T06:01:03.000Z","size":57,"stargazers_count":33,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-29T09:42:13.502Z","etag":null,"topics":["ios","swift","uibutton"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Otbivnoe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-12T08:22:52.000Z","updated_at":"2023-01-28T06:26:33.000Z","dependencies_parsed_at":"2022-11-01T23:17:07.432Z","dependency_job_id":null,"html_url":"https://github.com/Otbivnoe/NxEnabled","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Otbivnoe%2FNxEnabled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Otbivnoe%2FNxEnabled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Otbivnoe%2FNxEnabled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Otbivnoe%2FNxEnabled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Otbivnoe","download_url":"https://codeload.github.com/Otbivnoe/NxEnabled/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228543227,"owners_count":17934446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","swift","uibutton"],"created_at":"2024-01-05T20:16:27.358Z","updated_at":"2024-12-07T00:31:09.999Z","avatar_url":"https://github.com/Otbivnoe.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["TextField \u0026 TextView","Other free courses"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"http://i.imgur.com/XZFkFei.png\" alt=\"NxEnabled\"/\u003e\n\u003c/p\u003e\n\n[![Build Status](https://travis-ci.org/Otbivnoe/NxEnabled.svg?branch=master)](https://travis-ci.org/Otbivnoe/NxEnabled)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](#carthage)\n[![CocoaPods compatible](https://img.shields.io/cocoapods/v/NxEnabled.svg)](#cocoapods) \n![Swift 3.0.x](https://img.shields.io/badge/Swift-3.0.x-orange.svg) \n![platforms](https://img.shields.io/badge/platforms-iOS-lightgrey.svg) \n\n## What is NxEnabled?\n\nIt'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.\n\n## Getting started :rocket:\n\nTypical login screen with short, beautiful validation code:\n\n```swift\nloginButton.isEnabled(by: usernameTextField, passwordTextField) { username, password in\n    username.characters.count \u003e 5 \u0026\u0026 password.characters.count \u003e 5\n}\n```\n\nyou can also combine together `UITextView` with `UITextField`'s:\n\n```swift\nsignUpButton.isEnabled(by: firstnameTextField, lastnameTextField, bioTextView) { firstname, lastname, bio in\n    return /* validation value */\n}\n```\n\n*So there is also oportunity to add not UI element:*\n\n\n* Implement `Textable` protocol\n  \n* Be a successor from `NSObject`\n  \n* Not forget about `dynamic` label for property\n  \n* Done.\n  \n```swift\nclass Object: NSObject, Textable {\n    dynamic var value: String?\n    var textKey: String {\n        return \"value\"\n    }\n}\n```\n\n### NOTE:\n**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.**\n\n```swift\ndeinit {\n    signUpButton.clearBag()\n}\n```\n\n### **Now library allows to add textable elements up to six. :clap:**\n\n\n## Installation :fire:\n\n#### CocoaPods\n\nTo integrate NxEnabled, simply add the following line to your `Podfile`:\n\n```ruby\npod \"NxEnabled\"\n```\n\n#### Carthage\n\nTo integrate NxEnabled into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"Otbivnoe/NxEnabled\"\n```\n\nRun `carthage update` to build the framework and drag the built `NxEnabled.framework` into your Xcode project.\n\n## Author :muscle:\n\nNikita Ermolenko, gnod94@gmail.com\n\n## License :exclamation:\n\nNxEnabled is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOtbivnoe%2FNxEnabled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOtbivnoe%2FNxEnabled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOtbivnoe%2FNxEnabled/lists"}