Bouke/SwiftInitializerGenerator
Bouke/SwiftInitializerGenerator has 713 GitHub stars and 30 forks. GitHot measured 0 stars in 24 hours and -1 in 7 days. Last checked 2026-11-22 17:47 UTC. Last push 2019-08-13.
实测星标增长
- 24小时
- 0
- 7天
- -1
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
关于
Xcode Source Code Extension to Generate Swift Initializers
开发工具README.md
原文Swift Initializer Generator
This Xcode Source Code Extension will generate a Swift initializer based on the lines you've selected. Handy if you made a struct public and now you have to provide the initializer implementation yourself.
Usage
Select the lines with the attributes that should be included in the initializer. See below; > is the start of the selection and < is the end of the selection.
struct MyStruct {
> public var a: String
public var b: Int<
}
Run the extension's "Generate Swift Initializer". Voila! The code above is modified to:
struct MyStruct {
public var a: String
public var b: Int
public init(a: String, b: Int) {
self.a = a
self.b = b
}
}

Installation
On OS X 10.11 El Capitan, run the following command and restart your Mac:
sudo /usr/libexec/xpccachectlOpen
SwiftInitializerGenerator.xcodeprojEnable target signing for both the Application and the Source Code Extension using your own developer ID
Product > Archive
Right click archive > Show in Finder
Right click archive > Show Package Contents
Drag
Swift Initializer Generator.appto your Applications folderRun
Swift Initializer Generator.appand exit again.Go to System Preferences -> Extensions -> Xcode Source Editor and enable the extension
The menu-item should now be available from Xcode's Editor menu.
Known limitations
It will only parse attributes defined like (open|public|fileprivate|private|internal) [weak] (var|let) NAME: TYPE.
探索相关项目
加载中…