I wrote a semantic version number struct in Swift 4.1 that someone might find useful.