All Projects → wwmz → WMZForm

wwmz / WMZForm

Licence: MIT license
一个功能强大的表单组件,可自定义(A powerful form component that can be customized)

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to WMZForm

vue-sku-form
基于 Vue & ElementUI 的电商 SKU 表单配置组件
Stars: ✭ 94 (+147.37%)
Mutual labels:  form
Open-APIs
Collection of Unlimited APIs
Stars: ✭ 55 (+44.74%)
Mutual labels:  form
SuluFormBundle
Form Bundle for handling Dynamic and Symfony Forms in https://sulu.io
Stars: ✭ 51 (+34.21%)
Mutual labels:  form
react-formulation
Simple React form validation
Stars: ✭ 14 (-63.16%)
Mutual labels:  form
react-native-masked-input-text
A typescript masked input component for react-native
Stars: ✭ 14 (-63.16%)
Mutual labels:  form
forms
A library to easily define and create forms, written in Kotlin
Stars: ✭ 39 (+2.63%)
Mutual labels:  form
svelte-multistep-form
Svelte MultiStep Form like, this component is still in beta stage
Stars: ✭ 29 (-23.68%)
Mutual labels:  form
cypress-upload-file-post-form
Solution for two Cypress testing use-cases I came across with: perform a direct http FORM request to the server containing a file and other parameters and upload a file into a form before submission
Stars: ✭ 59 (+55.26%)
Mutual labels:  form
XFSettings
基于UITableView的界面定制,目标是更快更方便地构建设置界面,特点是易维护、可扩展性强。
Stars: ✭ 62 (+63.16%)
Mutual labels:  setting
react-useForm
World's simplest React hook to manage form state
Stars: ✭ 30 (-21.05%)
Mutual labels:  form
p01contact
Create contact forms by writing simple tags. Also a plugin for GetSimple and Pico CMS.
Stars: ✭ 15 (-60.53%)
Mutual labels:  form
react-search
This package will help you create a pretty good and beautiful search. And other related features
Stars: ✭ 17 (-55.26%)
Mutual labels:  form
react-hooks-form
React Forms the Hooks Way
Stars: ✭ 25 (-34.21%)
Mutual labels:  form
neat-form
Build form on Android using JSON schema; also includes view validation and skip logic.
Stars: ✭ 56 (+47.37%)
Mutual labels:  form
validator.js
(Depreciated) A Laravel styled JavaScript Object/Form/JSON validation library.
Stars: ✭ 47 (+23.68%)
Mutual labels:  form
aurelia-form
Fun with forms! Form utilities to make stuff just a bit (a lot) easier.
Stars: ✭ 34 (-10.53%)
Mutual labels:  form
react-jsonschema-formbuilder
No description or website provided.
Stars: ✭ 45 (+18.42%)
Mutual labels:  form
vue-example
Vue.js example application (server-side rendering, router, vuex store, form validation, i18n & l10n)
Stars: ✭ 62 (+63.16%)
Mutual labels:  form
scalable-form-platform
A solution for building dynamic web forms with visual editor
Stars: ✭ 109 (+186.84%)
Mutual labels:  form
antd-react-form-builder
Example
Stars: ✭ 74 (+94.74%)
Mutual labels:  form

WMZForm

先看看效果吧

实现页面 图片
单纯表单页面(可各种配置调样式) 单纯表单.gif
实现的一个简单朋友圈 朋友圈.gif
简单实现一些设置的界面 设置.gif
所有属性的页面-比较多比较杂乱 所有属性.gif

简单一句话概括这个控件 - 表单~不止于表单

特效

  • 支持可自定义cell,cell需要继承于baseCell
  • 支持实现目前大多数表单的功能
  • 支持自定义选择弹窗的内容
  • 性能优化,高度缓存
  • 可链式可属性轻松调用
  • 可自定义cell上的ui控件
  • 可自定义无数据占位图

目前自带的样式介绍

  • FormCellDefault ~ 默认样式
  • FormCellNormal ~ 左右文本
  • FormCellIcon ~ 带图片+文本
  • FormCellInput ~ 单行输入框
  • FormCellText ~ 只有一个文本
  • FormCellTextView ~ 多行输入
  • FormCellVerification ~ 验证码输入
  • FormCellImage ~ 九宫格选择/显示图片
  • FormCellSwitch ~ 开关
  • FormCellCheck ~ 选择
  • FormCellTag ~ 标签
  • FormCellCommit ~ 按钮
  • FormCellEdit ~ 编辑
  • FormCellTakePicture~ 添加图片

用法介绍

初始化添加数据 - 属性有点多这里没法一次性说清 详情可以看demo 或者来问我

    //初始化
     WMZForm *form =
     Form(CGRectMake(0, NavigationBar_Form_Height, self.view.bounds.size.width , self.view.bounds.size.height - NavigationBar_Form_Height))

    //直接不带section 用row直接添加
    .wAddFormRow(^(WMZFormRowModel * _Nullable rowModel) {
        rowModel
        .wFormValue(@"AllPropertiesVC")
        .wFormName(@"全部属性demo")
        .wFormCellAccessoryType(UITableViewCellAccessoryDisclosureIndicator)
        .wFormShowLine(YES);
    });

    //直接section添加 WMZFormRowModel为子集
    .wAddFormSection(^(WMZFormSectionModel * _Nullable sectionModel) {
          //子集
          WMZFormRowModel *rowModel =
          FormRowModel()
          //tableviewCell的类名 自定义的时候传@"customCellName"你创建的cell的类名即可
          .wFormCellName(@(FormCellCommit))
          .wFormRowData(@{@"fill":@(YES),@"type":@(FormClickClick)})
           //自定义button
          .wFormCustomButton(^(UIButton * _Nullable button) {
              button.backgroundColor = [UIColor whiteColor];
              [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
          })
          .wFormBtn(@"退出");
        
          sectionModel
          .wFormHeadHeight(20)
          .wFormFootHeight(20)
           //添加section的数据 rowModel组成的数据
          .wFormSectionData(@[rowModel])
          .wFormCellName(@(FormCellTag));
    });

直接添加也可以

 //添加row
 [form wAddFormRow:addModel atIndex:0];
//添加section
 [form wAddFormSection:sectionModel atIndex:1];

代理方法

/*
 *formCell点击
 @param cell  所在的cell (cell.model为model cell.indexPath 为其所在的indexPath)
 */
- (void)form:(WMZForm*)form didSelectRowAtCell:(WMZFormBaseCell*)cell;

/*
 *form提交
 @param commitInfo  提交的信息 为一个带value和key的字典
 @param success  是否通过检验规则可以提交
 */
- (void)form:(WMZForm*)form info:(NSDictionary*)commitInfo canCommit:(BOOL)success;

/*
 *formCell上的view点击 用于cell上的控件的交互事件
 @param clickView  点击的view
 @param cell  所在的cell
 @param action  根据action判断交互的事件
 */
- (void)form:(WMZForm*)form
        subViewDidSelectRowAtCell:(WMZFormBaseCell*)cell
        view:(UIView*)clickView
        type:(id)action;

数据更新删除等 提供了多个实例方法

 //addRow 非初始化增加row调用 默认插入最后
- (BOOL)wAddFormRow:(WMZFormRowModel*)rowModel;
//addRow 非初始化增加row调用 插入index的位置 传入-1不刷新
- (BOOL)wAddFormRow:(WMZFormRowModel*)rowModel atIndex:(NSInteger)index;
//addRow 非初始化增加row调用 插入index的位置 传入-1不刷新
- (BOOL)wAddFormRowBlock:(FormRowBlock)addFormRow atIndex:(NSInteger)index;
//addSection 非初始化增加section调用 默认插入最后
- (BOOL)wAddFormSection:(WMZFormSectionModel*)sectionModel;
//addSection 非初始化增加section调用 插入index的位置 传入-1不刷新
- (BOOL)wAddFormSection:(WMZFormSectionModel*)sectionModel atIndex:(NSInteger)index;
//addSection 非初始化增加section调用 插入index的位置 传入-1不刷新
- (BOOL)wAddFormSectionBlock:(FormSectionBlock)addFormSection atIndex:(NSInteger)index;
//deleleSectionWithKey
- (BOOL)wDeleteFormSectionWithKey:(NSString*)key;
//deleleSectionWithKey
- (BOOL)wDeleteFormSectionWithIndex:(NSInteger)index;
//deleleRowWithKey
- (BOOL)wDeleteFormRowWithKey:(NSString*)key;
//deleleRowWithIndexPath
- (BOOL)wDeleteFormRowWithIndexPath:(NSIndexPath*)indexPath;
//reloadRow With key
- (BOOL)wReloadRowWithKey:(NSString*)key;
//reloadRow With indexPath
- (BOOL)wReloadRowWithIndexPath:(NSIndexPath*)indexPath;
//reloadSection With key
- (BOOL)wReloadSectionWithKey:(NSString*)key;
//reloadSection With index
- (BOOL)wReloadSectionWithIndex:(NSInteger)index;
//getRow With key
- (WMZFormRowModel*)wFindRowModelWithKey:(NSString*)key;
//getRow With indexPath
- (WMZFormRowModel*)wFindRowModelWithIndexPath:(NSIndexPath*)indexPath;
//getSection With key
- (WMZFormSectionModel*)wFindSectionModelWithKey:(NSString*)key;
//getSection With index
- (WMZFormSectionModel*)wFindSectionModelWithIndex:(NSInteger)index;
//reloadData
- (void)wReloadData;
//自定义刷新
- (void)wReloadData:(FormCustomReload)block;

安装

CocoaPods

  1. 将 cocoapods 更新至最新版本.
  2. 在 Podfile 中添加 pod 'WMZForm'
  3. 执行 pod installpod update
  4. 导入 #import "WMZForm.h"。

注:要消除链式编程的警告

要在Buildding Settings 把CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF 设为NO

手动安装

  1. 下载 WMZForm 文件夹内的所有内容。
  2. 将 WMZForm 内的源文件和依赖的库添加(拖放)到你的工程。
  3. 导入 #import "WMZForm.h"

依赖

1WMZDialog(弹窗控件) 2 Masonry 3 SDWebImage 4 IQKeyboardManager

使用过程中如果有什么bug欢迎给我提issue 我看到就会解决 觉得有用的话给个star

简书地址

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].