This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum China: Int { | |
case Guangzhou = 0 | |
case Beijing | |
var description: String { | |
switch self { | |
case .Guangzhou: | |
return "广州" | |
case .Beijing: | |
return "北京" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NumbersParser: NumberParser { | |
static let sharedInstance = NumbersParser() | |
func numberToChinese(number: Int) -> String { | |
let numbers = String(number).characters | |
var finalString = "" | |
for singleNumber in numbers { | |
let string = singleNumberToChinese(number: singleNumber) | |
finalString = "\(finalString)\(string)" | |
} | |
return finalString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(instancetype)init { | |
return [super initWithStyle:UITableViewStylePlain]; | |
} | |
-(instancetype)initWithStyle:(UITableViewStyle)style { | |
return [self init]; | |
} | |
-(void)viewDidLoad { | |
[super viewDidLoad]; | |
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"UITableViewCell"]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*模型实现*/ | |
double order; | |
if ([self.allItems count]==0) { | |
order = 1.0; | |
} else { | |
order = [[self.privateItems lastObject] orderingValue]+1.0; | |
} | |
NSLog(@"Adding after %d items, order=%.2f",[self.privateItems count], order); | |
/*模型实现*/ |
NewerOlder