3

工具篇之自定义检查版本更新提示弹框

 3 years ago
source link: https://www.devashen.com/blog/2018/03/14/geng-xin/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

工具篇之自定义检查版本更新提示弹框

Mar 14th, 2018 6:06 pm | 评论

对于一些app的更新弹框,使用系统自带的Alert弹框,文字排版总是对不齐,没有美观,像我这样有点强迫症的,看到都别扭,更别说去点击更新了,于是乎,就自己动手做了一个,不管怎么样,看着舒服多了。

此处不废话,看效果

由于这个工具开发过于简单,我这里就不讲述如何开发实现的了,想要看具体实现的,我已在github上公开源码(ZASUpdateAlert),可自行查看去吐槽。

本着学习的态度,写了这个工具,又本着学习的态度,上传到了cocoapods上面,也是人生第一次上传代码到cocoapods,着实搞了一个下午,传了删,删了又传,最终也算是成功了。

鉴于我搞了半天才搞定如何上传自己的库到cocoapods,后续我会写一篇基础教材,到底该如何上传,同时也为自己以后再次使用时,少走坑,快速实现人生理想。

CocoaPods安装

pod 'ZASUpdateAlert', '~> 0.1.0'

只需将ZASUpdateAlert文件夹拖到项目中。

如果是使用的是CocoaPods,第一步需要先导入ZASUpdateAlert

import ZASUpdateAlert
ZASUpdateAlert.show(version: "V1.6", content: "1.全新UI界面\n2.更好的性能体验\n3.投诉系统极速反馈\n4.多个BUG虫的尸体都不复存在", appId: "xxxxxxxx", isMustUpdate: false)

示例源代码

点击查看ZASUpdateAlert源码去吐槽喽

Posted by Ashen

Mar 14th, 2018 6:06 pmiOS

« 《三体》之读后随记 自动生成混淆文件(swift版) »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK