最新回答 / 渊鸿
MVC的分离和语言访问的权限控制iOS开发的MVC模式就是模型、视图与控制器相分离的,用户需要做的就是将这三者联系起来语言访问的权限控制应该是使用代码控制用户的访问权限吧。。
2015-07-13
@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