Skip to content

根据 xib 文件自动生成属性、添加视图、约束和Getter方法代码。

License

Notifications You must be signed in to change notification settings

devdawei/DVVXibToCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DVVXibToCode

根据 xib 文件自动生成属性、添加视图、约束(使用PureLayout)和Getter方法代码。

使用方式

  1. 下载并运行项目,运行好后会打开主窗体;
  2. 将 xib 文件路径拖到 Xib File Path 中;
  3. 选择 Xib File Type;
  4. 点击 Cover 即可转换;

xib文件注意事项

  1. 新建好xib文件后,将xib文件的Use Safe Area Layout Guides选项去掉。如下图红框中所示: Uncheck Use Safe Area Layout Guides.png

  2. 拖完控件后,一定要更改控件名,因为生成的属性名就是控件名。如下图红框中所示: Change_control_name.png

  3. 添加约束时,需要先把Constrain to margins选项去掉。如下图红框中所示: Uncheck Constrain to margins.png

目前所支持的 xib 文件类型

  • UIView
  • UIViewController
  • UITableViewCell
  • UICollectionViewCell

目前所支持的控件及属性

颜色设置:目前仅支持通过 RGB Sliders 设置。
字体设置:System 类型目前仅支持设置 Style(Regular、Bold) 和 Size;Custom 类型可设置 Family,Style,Size。

  • UIView
    • Background
  • UILabel
    • Text(Plain)
    • Color
    • Font
    • Alignment
  • UITextField
    • Color
    • Font
    • Alignment
    • Placeholder
  • UITextView
    • Text(Plain)
    • Color
    • Font
    • Alignment
  • UIButton
    • Type(Custom、System)
    • State Config(Default)
    • Title(Plain)
    • Font
    • Text Color
  • UIImageView
    • Image
  • UISwitch
  • UITableView
    • Style(Plain、Grouped)
  • UIScrollView

自动生成效果

DVVXibToCode.png

About

根据 xib 文件自动生成属性、添加视图、约束和Getter方法代码。

Resources

License

Stars

Watchers

Forks

Packages

No packages published