You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-18Lines changed: 27 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
#Semantic Versioning
2
-
---
3
2
4
-
Semantic Version implementation in Swift!
5
-
Use the struct `SemanticVersion` to represents a version according to the [Semantic Versioning Sepcification 2.0.0](http://semver.org/spec/v2.0.0.html).
3
+
Semantic Versioning implementation in Swift!
4
+
Use the struct `SemanticVersion` to represents a version according to the [Semantic Versioning Specification 2.0.0](http://semver.org/spec/v2.0.0.html).
6
5
7
6
8
7
Fully Unit tested
@@ -11,7 +10,6 @@ Fully Unit tested
11
10
12
11
13
12
##Getting Started
14
-
---
15
13
16
14
### Requirements
17
15
@@ -52,11 +50,11 @@ For application targets that do not support embedded frameworks, such as iOS 7,
52
50
You can add a git submodule and drag and drop the sources into the project navigator.
53
51
54
52
##Usage
55
-
---
56
53
57
54
Create version 2.0.0
58
55
59
-
```Swift let version = SemanticVersion(major: 2)
56
+
```Swift
57
+
let version =SemanticVersion(major: 2)
60
58
```
61
59
62
60
Create version 1.2.3
@@ -68,7 +66,8 @@ let version = SemanticVersion(major: 1, minor: 2, patch: 3)
68
66
Create version 1.0.0-alpha.2
69
67
70
68
```Swift
71
-
let version =SemanticVersion(major: 1, preReleaseIdentifier: ["alpha", "2"]) ```
69
+
let version =SemanticVersion(major: 1, preReleaseIdentifier: ["alpha", "2"])
70
+
```
72
71
73
72
Create version from a String
74
73
@@ -88,17 +87,31 @@ Check if is prerelease version or not
88
87
if version.isPrerelease { ... }
89
88
```
90
89
91
-
Access the prerelease identifier
90
+
Access the prerelease identifier via the preReleaseIdentifier Array
92
91
93
-
``` ... ```
92
+
```Swift
93
+
for identifier in version.preReleaseIdentifier
94
+
{
95
+
// ...
96
+
}
97
+
```
94
98
95
-
Access the build meta data
99
+
Access the build metadata identifier via the buildMetadataIdentifier Array
96
100
97
-
``` ... ```
101
+
```Swift
102
+
for identifier in version.buildMetadataIdentifier
103
+
{
104
+
// ...
105
+
}
106
+
```
98
107
99
-
Conforms to Printable so you can simply get a String representation
108
+
Conforms to Printable so you can simply get a String representation by accessing the description property
100
109
101
-
``` println(version) ```
110
+
```Swift
111
+
println(version)
112
+
// OR
113
+
let stringRepresentation = version.description
114
+
```
102
115
103
116
mutability / immutability
104
117
@@ -116,23 +129,19 @@ They will only comapre the major, minor and patch version but not the prerelease
116
129
117
130
118
131
##Parser
119
-
---
120
132
121
133
The implementation includes a full-fledged component ot parse String representation of a version. Please have a look at the tests and the soruce of `SemanticVersionParser` for now 😉
122
134
123
135
##Tests
124
-
---
125
136
126
137
The libary includes a suite of tests showing how to use the different initialiser and the Parser
127
138
128
139
129
140
##Author
130
-
---
131
141
132
142
Find me on Twitter as [@Ajax64](https://twitter.com/ajax64).
133
143
134
144
135
145
##License
136
-
---
137
146
138
-
Version is available under the MIT license. See the LICENSE file for more info.
147
+
Version is available under the MIT license. See the LICENSE file for more info.
0 commit comments