@IBAction func confirmTapped() {
if let birthYear = yearOfBirth.text.toInt(){
let seachResult = parseYearGetShuXiangInfo(seachYear: birthYear)
shuxiangImg.image = UIImage(named: String(seachResult.imgNumb))
yearOfShuXiang.text = seachResult.shuXiangTxt...
if let birthYear = yearOfBirth.text.toInt(){
let seachResult = parseYearGetShuXiangInfo(seachYear: birthYear)
shuxiangImg.image = UIImage(named: String(seachResult.imgNumb))
yearOfShuXiang.text = seachResult.shuXiangTxt...
2015-07-13
var shuXiangImgNumb = (year - offset) % shengXiaoCount
var shuXiangTxt = imgReflectArr[(year - offset) % shengXiaoCount]
return (shuXiangImgNumb, shuXiangTxt)
}
var shuXiangTxt = imgReflectArr[(year - offset) % shengXiaoCount]
return (shuXiangImgNumb, shuXiangTxt)
}
2015-07-13
func parseYearGetShuXiangInfo(seachYear year: Int) ->(imgNumb: Int,shuXiangTxt: String){
var imgReflectArr = ["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
var baseYear = 2008
var shengXiaoCount = imgReflectArr.count
var offset = baseYear % shengXiaoCount
var imgReflectArr = ["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
var baseYear = 2008
var shengXiaoCount = imgReflectArr.count
var offset = baseYear % shengXiaoCount
2015-07-13
到模拟器 “设置-语言和地区”,分别设置为中文和中国,就可以分享到新浪微博了,即使没有账号也不会崩溃
2015-07-11
let cell = tableView.dequeueReusableCellWithIdentifier("todoCell") as! UITableViewCell
2015-07-08