Skip to content

Commit 7b90e07

Browse files
Update README.md
1 parent 6e45efe commit 7b90e07

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ImmutableSwift
22

3-
ImmutableSwift is a tool that generates swift model with supports for immutability, coding(Coding and NSCoding), value comparions, hashing and copying. Directly inspired by [facebook/remodel](https://github.com/facebook/remodel).
3+
ImmutableSwift is a tool that generates swift models with support for immutability, coding(Coding and NSCoding), value comparions, hashing, and copying. Directly inspired by [facebook/remodel](https://github.com/facebook/remodel).
44

5-
TLDR: generate this
5+
TLDR: generate this...
66
```
77
import Foundation
88
@@ -30,7 +30,7 @@ class Friend : Hashable, Codable, NSCopying{
3030
}
3131
}
3232
```
33-
from this
33+
...from this
3434
```
3535
Friend {
3636
String name
@@ -49,27 +49,27 @@ $ swift build -c release
4949
```
5050

5151
## Usage
52-
To generate a model, you must first create a `.value` file that contains the modle schema. Here is an example:
52+
To generate a model, you must first create a `.value` file that contains the model schema. Here is an example:
5353
```
5454
Friend {
5555
String name
5656
Int daySinceFirstMet
5757
}
5858
```
5959

60-
Once you created the schema file, you can generate the desired swift model with
60+
Once you create the schema file, you can generate the desired swift model with
6161
```
6262
./ImmutableSwift Path/To/ModelDirectory/Friend.value
6363
```
6464

65-
To generate models for every .value files in a directory, subtitute the file path with a directory path
65+
To generate models for each .value file in a directory, substitute the file path with a directory path
6666
```
6767
# this will also generate every .value files in any sub-directories recursively
6868
./ImmutableSwift Path/To/ModelDirectory/
6969
```
7070

7171
## Import
72-
ImmutableSwift assumes that every types that a model depends on reside in the same module. If a model depends on another module, simply add the required module on top of the schema. For example:
72+
ImmutableSwift assumes that all types that a model depends on reside in the same module. If a model depends on another module, simply import the required module on top of the schema. For example:
7373
```
7474
import PhoneNumber
7575
Friend {
@@ -78,7 +78,7 @@ Friend {
7878
PhoneNumber number
7979
}
8080
```
81-
The syntax for import are the same as swift's import syntax. You can import a module with `import module`, import a submodule with `improt module.submodule` or import a specific kind of symbol with `import kind module.symbole`
81+
The syntax for import is the same as Swift's import syntax. You can import a module with `import module`, import a submodule with `import module.submodule` or import a specific kind of symbol with `import kind module.symbol`
8282

8383
## Comments
8484
ImmutableSwift supports adding comments to the generated models.
@@ -95,7 +95,7 @@ Friend {
9595
```
9696

9797
## AccessControl
98-
ImmutableSwift supports defining optional access levels for the generated model. At the moment, it only supports `public` and `internal`. This is mainly to help generate models in a module that are meant to be imported. For example:
98+
ImmutableSwift supports defining optional access levels for the generated models. At the moment, it only supports `public` and `internal`. This is mainly to help generate models in a module that are meant to be imported. For example:
9999
```
100100
public Friend {
101101
String name
@@ -104,9 +104,9 @@ public Friend {
104104
```
105105

106106
## NSCoding
107-
In some projects, immutable data model might need to support NSCoding. To have ImmutableSwift generates associated methods that support NSCoding, include the plugin `ISCoding` in the model's schema.
107+
In some projects, immutable data models might need to support NSCoding. To have ImmutableSwift generate associated methods that support NSCoding, include the plugin `ISCoding` in the model's schema.
108108
```
109-
# here, ISCoding plugin is responsible for generating the encode and init method required by NSCoding protocol
109+
# ISCoding plugin is responsible for generating the encode and init method required by NSCoding protocol
110110
# ISCopying plugin is responsible for generating the copy method required by the NSCopying protocol
111111
public Friend (ISCoding, ISCopying){
112112
String name
@@ -115,21 +115,21 @@ public Friend (ISCoding, ISCopying){
115115
```
116116

117117
## Plugins
118-
Similar to [facebook/remodel](https://github.com/facebook/remodel), ImmutableSwift uses a simple plugin system. The plugin system are designed to encapsulate cohesive generation logics, and extend the functionality of the code generator. You can find a list of plugins here: https://github.com/hackthehackerman/ImmutableSwift/tree/master/Sources/ImmutableSwift/generating/plugins.
118+
Similar to [facebook/remodel](https://github.com/facebook/remodel), ImmutableSwift uses a simple plugin system. The plugin system is designed to encapsulate cohesive generation logic, and extend the functionality of the code generator. You can find a list of plugins here: https://github.com/hackthehackerman/ImmutableSwift/tree/master/Sources/ImmutableSwift/generating/plugins.
119119

120-
To specify plugins for a specific model, add the list after the model name. Noted that, if you don't specific a list of plugins to used, ImmutableSwift will use a default list of plugins: [ISCodable, ISHashable, ISCopying].
120+
To specify plugins for a specific model, add the list after the model name. Note that, if you don't specify a list of plugins to be used, ImmutableSwift will use a default list of plugins: [ISCodable, ISHashable, ISCopying].
121121
```
122-
# ISCodable is responsible for generating codes for the Codable protocol
122+
# ISCodable is responsible for generating code for the Codable protocol
123123
# ISHashable is responsible for generating the == and hash function for the Hashable protocol
124-
# ISCopying plugin is responsible for generating the copy method required by the NSCopying protocol
124+
# ISCopying is responsible for generating the copy method required by the NSCopying protocol
125125
public Friend (ISCodable, ISHashable, ISCopying){
126126
String name
127127
Int daySinceFirstMet
128128
}
129129
```
130130

131131
## Contributing
132-
Pull requests are very welcomed!
132+
Pull requests are very welcome!
133133

134134
## License
135135
MIT License

0 commit comments

Comments
 (0)