Latest 2.0.1
License Apache
Platforms ios 10.0

This is a model validator for Swift


  • Not dependent on external frameworks.
  • Light weight.

How to use

Model class realize RNValidatable protocol.

class ProfileEntity : RNValidatable {
    var firstName:String
    var lastName:String

    init(firstName:String, lastName:String){
        self.firstName = firstName
        self.lastName = lastName

    func bindConstraint(binder: RNConstraintBinder) {
        binder.bind(firstName, accessTag: "firstName")
            .add(constraint:RNConstraintLength(max: 10, errorMessage: "Invalid range"))
            .add(constraint:RNConstraintAlphabet(errorMessage: "Only alphabets."))
        binder.bind(lastName, accessTag: "lastName")
            .add(constraint:RNConstraintLength(max: 10, errorMessage: "Invalid range"))
            .add(constraint:RNConstraintAlphabet(errorMessage: "Only alphabets."))

RNValidator call validate method.
parameter is model realized RNValidatable protocol.

let results = model.rn.validate()
if results.isInvalid {
    if let firstNameErrorMessages = results.fields["firstName"] {
        firstNameMessageLabel.text = firstNameErrorMessages.messages.joined(separator:"n")
    if let lastNameErrorMessages = results.fields["lastName"] {
        lastNameMessageLabel.text = lastNameErrorMessages.messages.join(separator:"n")

Runtime Requirements

  • iOS 10 later
  • Swift 3.0 later

Installation and Setup

Support CocoaPods

pod 'RNMoVali', '~> 2.0'


I am a Japanese programmer, so I have some trouble writing in English.
You may find a typo or mistake but just be nice with your feedback.

Thank you for your support and kindness.

Latest podspec

    "name": "RNMoVali",
    "version": "2.0.1",
    "summary": "The RNMoVali is a model validator for Swift.",
    "description": "This is a model validator for Swift. It's Simply but good partner.",
    "homepage": "",
    "license": {
        "type": "Apache",
        "file": "LICENSE"
    "authors": {
        "Motoki Kawakami": "[email protected]"
    "source": {
        "git": "",
        "tag": "2.0.1"
    "social_media_url": "",
    "platforms": {
        "ios": "10.0"
    "source_files": "RNMoVali/*.swift"

Pin It on Pinterest

Share This