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.
Progression mesurée des étoiles
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- Historique en cours
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
À propos
Xcode Source Code Extension to Generate Swift Initializers
Outils de développementREADME.md
OriginalSwift 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.
Explorer des projets similaires
Chargement…