Latest 0.1.1
Homepage https://github.com/AbbasTorabi/ZdataBinding
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Example

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

you must create Dynamic variable to bind textfiled value.
like this:

import ZdataBinding

class ViewControllerViewModel {

  var my_variable: Dynamic<String> = Dynamic("")

}

your viewController class & textfiled must like this:

import ZdataBinding

class ViewController: UIViewController {

    var viewModel : ViewControllerViewModel! {
        didSet {
        // bind from viewModel to view
        viewModel.my_variable.bind = { [unowned self] in self.myTextField.text = $0 }
        }
    @IBOutlet weak var myTextField: BindingTextField! {
        didSet {
        // bind from view to viewModel
            self.myTextField.bind { self.viewModel.my_variable.value = $0 }
        }
      }
        override func viewDidLoad() {
        super.viewDidLoad()
        viewModel = ViewControllerViewModel()
        }
   }

Installation

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

pod 'ZdataBinding'

Author

AbbasTorabi

mail: [email protected]

License

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

Latest podspec

{
    "name": "ZdataBinding",
    "version": "0.1.1",
    "summary": "The library for two way data binding & add listener for hear values change.",
    "description": "The library for two way data binding & add listener for hear values change. just install the lib & enjoye that.",
    "homepage": "https://github.com/AbbasTorabi/ZdataBinding",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "AbbasTorabi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/AbbasTorabi/ZdataBinding.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ZdataBinding/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This