• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

iOS app版本更新CheckVersion_Swift

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

前言

CheckVersion_Swift 是一款轻量级的 Swift 版本的框架,框架功能:根据 Apple 提供的 API 去请求 JSON ,根据 JSON 中的版本号决定是否去更新原生 App。更新提示的内容可以自定义,也可以是 JSON 中给的内容。

写作 CheckVersion_Swift 框架初衷

通常在做 App 版本检查更新功能的时候,都是后台服务器为我们提供一个获取 App 最新版本信息的接口,并且在每次新版本更新后,都需要人工在后台更改版本信息,这样做其实也可以的,但是费事且不及时。

其实苹果提供了一个很友好的 iTunes 接口,供我们获取 App Store 中 App 当前的最新信息。

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

CheckVersion_Swift is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod \'CheckVersion_Swift\'

Use 

/// check version
///
/// - Parameters:
/// - appId: app id,eg: 414478124 of the wechat
/// - customContent: custom content,if the string is nil and the count of the string is greater
/// than zero,use custom content;Otherwise,use the content of the request data

public class func checkVersion(_ appId: String, _ customContent: String?)

 
 

// 直接显示接口中的更新内容
CheckVersion.checkVersion(kAppId, nil)

 

// 显示自定义的更新内容
CheckVersion.checkVersion(kAppId, "自定义的更新内容...")

License

CheckVersion_Swift is available under the MIT license. See the LICENSE file for more info.

Author

如果你有什么建议,可以关注我的公众号:iOS开发者进阶,直接留言,留言必回。

更多文章


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
swift苹果开发者cocoachina学习网站http://www.cocoachina.com/swift/发布时间:2022-07-13
下一篇:
新课程:Swift设计模式发布时间:2022-07-13
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap