Merge pull request #89 from TouchInstinct/fix/oneTwoMany

Fix/one two many
This commit is contained in:
Alexey Gerasimov 2017-09-28 18:15:25 +03:00 committed by GitHub
commit 5420410222
3 changed files with 9 additions and 3 deletions

View File

@ -11,3 +11,7 @@
## 0.5.8
- **Fix**: Synchronization over `NSRecursiveLock` for request count tracker in NetworkService
## 0.5.9
- **Fix**: One-two-many fixed for values more than 99

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "LeadKit"
s.version = "0.5.8"
s.version = "0.5.9"
s.summary = "iOS framework with a bunch of tools for rapid development"
s.homepage = "https://github.com/TouchInstinct/LeadKit"
s.license = "Apache License, Version 2.0"

View File

@ -31,10 +31,12 @@ public extension String {
stringTwo: String,
stringMany: String) -> String {
if (11...14).contains(value) {
let lastTwoDigits = value % 100
if (11...14).contains(lastTwoDigits) {
return stringMany
} else {
let lastDigit = value % 10
let lastDigit = lastTwoDigits % 10
switch lastDigit {
case 1: