Commit e6f8ff4d authored by 刘俊宏's avatar 刘俊宏

完善更新appUI

parent 4d7a7d0b
{
"images" : [
{
"filename" : "upapptop.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "upapptop@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "upapptop@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -11,6 +11,8 @@ protocol GeliAlertViewDelegate {
func sureGeliAlertViewAction(sender:UIButton)
}
class GeliAlertView: UIView {
@IBOutlet weak var versionLbl: UILabel!
@IBOutlet weak var upAppIconV: UIImageView!
var contentView:UIView!
var delegate: GeliAlertViewDelegate?
@IBOutlet weak var titileLbl: UILabel!
......
......@@ -608,10 +608,16 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
if appStoreVersion != oldappStoreVersion as!String {
self.updateStr = json["results"][0]["trackViewUrl"].string!
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.upAppIconV.isHidden = false
alertView.versionLbl.isHidden = false
alertView.versionLbl.text = "V" + json["results"][0]["version"].string!
alertView.delegate = self;
alertView.tishiLbl.text = json["results"][0]["releaseNotes"].string
alertView.titileLbl.text = "有新版本可更新"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "去更新"), for: .normal)
alertView.tishiLbl.text = ""
alertView.titileLbl.text = json["results"][0]["releaseNotes"].string
alertView.titileLbl.textAlignment = .left
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "立即更新"), for: .normal)
alertView.leftBtn.setAttributedTitle(NSAttributedString(string: "残忍拒绝"), for: .normal)
alertView.rightBtn.tag = 1515684912
alertView.appStoreVersion = appStoreVersion
self.view.window?.addSubview(alertView)
......@@ -619,10 +625,16 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
}else{
self.updateStr = json["results"][0]["trackViewUrl"].string!
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.upAppIconV.isHidden = false
alertView.versionLbl.isHidden = false
alertView.versionLbl.text = "V" + json["results"][0]["version"].string!
alertView.delegate = self;
alertView.tishiLbl.text = json["results"][0]["releaseNotes"].string
alertView.titileLbl.text = "有新版本可更新"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "去更新"), for: .normal)
alertView.tishiLbl.text = ""
alertView.titileLbl.text = json["results"][0]["releaseNotes"].string
alertView.titileLbl.textAlignment = .left
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "立即更新"), for: .normal)
alertView.leftBtn.setAttributedTitle(NSAttributedString(string: "残忍拒绝"), for: .normal)
alertView.rightBtn.tag = 1515684912
alertView.appStoreVersion = appStoreVersion
self.view.window?.addSubview(alertView)
......@@ -630,6 +642,7 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
}else{
print("不需要更新哦---")
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment