Skip to content

Instantly share code, notes, and snippets.

View Eeyore741's full-sized avatar
💭
🌏🌍🌎

Vitalii Kuznetsov Eeyore741

💭
🌏🌍🌎
View GitHub Profile
@Eeyore741
Eeyore741 / pineappleStringWithCount_objc.m
Last active July 9, 2018 13:52
Pineapples count functions
- (NSString *)pineappleStringWithCount:(int)count{
if (count == 0) {
return @"У Джона нет ананасов";
}
NSString *countString = [[NSString alloc] initWithFormat:@"%u", self.pineappleCount];
if (self.pineappleCount >= 10) {
//Objective-C
[NSString stringWithFormat:@"У Джона %u ананас", a];
//Swift
String.init(format: "У Джона %u ананас", count)
Существительное Количество Нужный текст Окончание
Pineapple 1 John has one pineapple (no)
Pineapple 5 John has 5 pineapples s
Pineapple n (n != 1) John has n pineapples s
@Eeyore741
Eeyore741 / plurals_en_en.csv
Last active July 7, 2018 14:32
Plurals example
Noun Count Expected text Noun ending
Pineapple 0 John has no pineapples s
Pineapple 1 John has 1 pineapple (no)
Pineapple 4 John has 4 pineapples s