An Open Source Mac app to created Automated Swift Classes + Extensions for your model
There are few models we have defined to draw dynamic code.
-
A:
Class
is a model which is crystal clear with name.Class
has few attributes that define its prior logic.- 1:
name
which store the name of class. - 2:
variables
is an Array of typeVariable
this array contains all entered variables. to add a variable in class you can use below method.
classObj.addVariable(name: "id", variableType: .string, shouldHaveSort: true, shouldHaveFilter: false)
- 1:
-
B:
Variable
is model to store information about a single variable.Variable
contains some attributes use for special purpose.- 1:
name
store the name of a variable. - 2:
type
is enumeration of typeVariableType
which store the data type of variable. - 3:
shouldHaveSortMethod
is boolean which interprets whether this class needs sorting method by this variable or not.By Default this attribute will be false
. - 4:
shouldHaveFindFilterMethod
is boolean which interprets whether this class needs filter and find methods for this variable or not.By Default this attribute will be false
. - 5:
variableSecurity
is an enumeration of typeCodeSecurity
which tell the access specifier of current variable.By default this will be .public
. - 6:
nameOfClass
this attributes contains the name of the class of which this variable belongs. You do not need to assign this value.
- 1:
-
C:
Extension
this is class which is responsible to create extension file for your class which desired method i.efilter/find/sort
. You just need to initialized like this.Extension(with: yourClassObject)
. Extension class will automatically traverse each variable and check if there is any variable that requested to have some method in extension or not. Just save this initialize extension. -
D:
File
is class of a file which have attributes.- 1:
name
is the name of creating file. - 2:
localURL
is the path where this file should store. - 3:
completeCode
is a string which have entire string of the code which will save in this file.
- 1:
Both
Class
andExtension
is the subclass of classFile
. This class holds the common properties of a class file and extension file.
Enumerations that we use in this projects are following.
enum CodeSecurity: String {
case publicVar = "public"
case internalVar = "internal"
case openVar = "open"
case privateVar = "private"
case filePrivateVar = "filePrivate"
}
enum VariableType: String {
case int = "Int"
case string = "String"
case float = "Float"
case double = "Double"
case bool = "Bool"
case date = "Date"
case void = "Void"
}
CodeSecurity
is being used for making any functions, variables and classes either public
, private
etc.
VariableType
is primarily used as DataType
of each variable which this enumeration can reuse as data type of a function as well.
Currently this project only focus to create only Swift classes. We are contributing to make development more riliable and fast. Your help will be appriciated and warmly welcome.
Owner