Coder Social home page Coder Social logo

checkversion_swift's Introduction

CheckVersion_Swift

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

写作 CheckVersion_Swift 框架初衷

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

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

效果图

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

/// 检查 app 是否需要去 AppStore 做版本更新
///
/// - Parameters:
///   - appId: appId
///   - completion: completion != nil时,显示自定义 view;completion == nil时,直接显示弹出框(显示API 请求内容)
public class func checkVersion(_ appId: String, _ completion: ((_ dict: [String: Any]) -> ())?)
// 直接显示 API请求的 内容
CheckVersion.checkVersion(kAppId, nil)
// 显示自定义 view
CheckVersion.checkVersion(kAppId, { (responseDict) in
    // TODO - 去自定义 view,可以参考demo去实现
})

License

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

Author

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

输入图片说明

checkversion_swift's People

Contributors

821385843 avatar

Stargazers

lausen Lau avatar Gamin avatar  avatar RyanCao avatar  avatar icc avatar  avatar Pdrl avatar  avatar lausen avatar Alex avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

checkversion_swift's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.