$ brew install ryu0118/magicib/magicib
USAGE: magicib [<project-path>] [<ib-path>] [--output-dir <output-dir>]
ARGUMENTS:
<project-path> The root directory of the project containing the IB
files you want to convert to Swift
<ib-path> Path of the Interface builder file you want to
convert to Swift
OPTIONS:
-o, --output-dir <output-dir>
Output directory for files converted to Swift
-h, --help Show help information.
当前目录是目标 iOS 项目目录
然后运行这个命令。
$ magicib .
指定生成的 Swift 文件的输出目录。
然后运行这个命令。
$ magicib . --output-dir ./output/
从单个 storyboard 文件生成 Swift 代码。
然后运行这个命令。
$ magicib ./Storyboards/HomeViewController.storyboard