Coder Social home page Coder Social logo

mindinventory / generatedynamiccustomform Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 6.0 6.46 MB

You can generate a dynamic form view in a few minutes for a signup, add a record. Creating a form is very easy.

Home Page: https://www.mindinventory.com/iphone-application-development.php

License: MIT License

Swift 99.69% Ruby 0.31%
swift form ios customcontroller signup register-form registration

generatedynamiccustomform's Introduction

Generate Dynamic Custom Form: Create your own form within a minute.

You can generate a dynamic form view in a few minutes for signup, add a record. Creating a form is very easy.

Preview

video

Table of content :-

Description

In this form there are various textFields like Username, email, Password, etc. it has validations also, if validation passes then user can submit form. If any validation doesn't pass then we are showing the validation using the label. The changes are reactive to the textField changes. User can also edit the form and can view changes.

Features

  • TextField with different types like email, password, mobile number, etc.
  • Profile Photo and Banner image selection.
  • TextView for Address field.
  • DatePicker for Date of Birth.
  • Picker for department selection.
  • ActionSheet for Gender selection.
  • PopUpView for selecting multiple/single values.
  • Multiple photos selection.
  • Switch control for toggling values.
  • Checkbox for accepting terms and conditions.
  • Submit button for saving data.
  • After Successful saving of data one can check entered data and also edit the data.

Usage

  • First create two enums one for Control Type and another one for TextField Type.
  1. In ControlType enum you can add cases for different controls like,

    • TextField
    • ProfileImage
    • Switch
    • TextView
    • CheckBox
enum ControlType {
    
    case checkBox
    case textField
    case profileImage
    case switchType
    case textView
    case multiPhoto
}
  • Based on that you can create different cells in TableView
  1. In TextField Type enum you can add cases for different TextField types like,

    • Normal Textfield
    • Password
    • Picker, date picker, etc.
enum TextFieldType: Equatable {
    
    case normal
    case password
    case dob
    case picker
    case actionSheet
    case selection(Bool?) // Pass true or false for Allowing multiple Selection
    case mobileNumber(Bool?) //Pass true or false for Country Flag
}
  • Based on that you can create different textfield with different keyboard type and inputView.
  1. After that create a Structure with two enums that we have created early and add additional properties based on your requirement like,

    • TextField value
    • Placeholder
    • Placeholder color
    • Keyboard type
    • Secure text entry, etc.
struct FormModel {
    
    var controlType: ControlType
    var txtFieldType: TextFieldType?
    var value: String?
    var placeHolder: String?
    var placeHolder2: String?
    var placeHolderColor: UIColor?
    var leftImgView: String?
    var rightImgView: String?
    var isEnabled: Bool?
    var isSecure: Bool?
    var keyboardType: UIKeyboardType?
    var isValid: Bool?
}
  • Based on this Structure you will be able to create a Model which will be used by Tableview.
FormModel(controlType: .profileImage), // Profile Image

FormModel(controlType: .textField, txtFieldType: .normal, value: "", placeHolder: placeHolderName, placeHolder2: "John Doe", placeHolderColor: .darkGray, leftImgView: "ic_user", rightImgView: nil, isEnabled: true, isSecure: false, keyboardType: .default, isValid: true), // Name

FormModel(controlType: .textField, txtFieldType: .normal, value: "", placeHolder: placeHolderEmail, placeHolder2: "[email protected]", placeHolderColor: .darkGray, leftImgView: "ic_email", rightImgView: nil, isEnabled: true, isSecure: false, keyboardType: .emailAddress, isValid: true), // Email

FormModel(controlType: .textField, txtFieldType: .password, value: "", placeHolder: placeHolderPassword, placeHolder2: "*******", placeHolderColor: .darkGray, leftImgView: "ic_password", rightImgView: nil, isEnabled: true, isSecure: true, keyboardType: .default, isValid: true), // Password

FormModel(controlType: .textField, txtFieldType: .mobileNumber(false), value: "", placeHolder: placeHolderMobNo, placeHolder2: "1234567890", placeHolderColor: .darkGray, leftImgView: nil, rightImgView: nil, isEnabled: true, isSecure: false, keyboardType: .phonePad, isValid: true), // Mobile number

FormModel(controlType: .textView, value: "", placeHolder: placeHolderAddress, placeHolder2: "21, Satelite Shopping Centre.", placeHolderColor: .darkGray, isEnabled: true, isSecure: false, keyboardType: .default, isValid: true), // Address (TextView)

FormModel(controlType: .textField, txtFieldType: .dob, value: "", placeHolder: placeHolderDob, placeHolder2: "DD/MM/YYYY", placeHolderColor: .darkGray, leftImgView: "ic_calender", rightImgView: nil, isEnabled: true, isSecure: false, keyboardType: .default, isValid: true), // Date of Birth (Date Picker)

FormModel(controlType: .textField, txtFieldType: .actionSheet, value: "", placeHolder: placeHolderGender, placeHolder2: "Select Male or Female", placeHolderColor: .darkGray, leftImgView: "ic_gender", rightImgView: nil, isEnabled: true, isSecure: false, keyboardType: .default, isValid: true), // Gender (Action Sheet)

FormModel(controlType: .textField, txtFieldType: .selection(false), value: "", placeHolder: placeHolderCountry, placeHolder2: "Select Conutry", placeHolderColor: .darkGray, leftImgView: "ic_flag", rightImgView: nil, isEnabled: true, isSecure: false, keyboardType: .default, isValid: true), // Countries India or Other

FormModel(controlType: .textField, txtFieldType: .selection(true), value: "", placeHolder: placeHolderHobbies, placeHolder2: "Select Hobbies", placeHolderColor: .darkGray, leftImgView: "ic_food", rightImgView: nil, isEnabled: true, isSecure: false, keyboardType: .default, isValid: true), // Hobbies (Multiple Selection View)

FormModel(controlType: .textField,txtFieldType: .picker, value: "", placeHolder: placeHolderDept, placeHolder2: "Select Department", placeHolderColor: .darkGray, leftImgView: "ic_dept", rightImgView: nil, isEnabled: true, isSecure: false, keyboardType: .default, isValid: true), // Department (Picker)

FormModel(controlType: .multiPhoto), // Multiple Photos

FormModel(controlType: .switchType), // Notifications (Switch)

FormModel(controlType: .checkBox) // Terms and Conditions (CheckBox)
  • After this you have to just pass enum case in cellForRow and accordingly pass model data into cell to generate Form. - Preview

By Apple

  • Xcode 12
  • iOS 11+

LICENSE!

GenerateDynamicCustomForm is MIT-licensed.

generatedynamiccustomform's People

Contributors

ashishpatelmi avatar nikunj-mindinventory avatar nikunjprajapati95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.