iOS app版本更新CheckVersion_Swift

iOS app版本更新CheckVersion_Swift

前言

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.

原文地址https://www.cnblogs.com/MrXie821385843/p/10476199.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值