Skip to content
This repository has been archived by the owner on Apr 10, 2022. It is now read-only.

📝 更新ReadMe iOS客户端介绍 #13

Merged
merged 1 commit into from
Mar 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,65 @@ link:src/main/asciidoc/_chapter/docker-manual.adoc[Docker 使用手册]
image::show1.png[]
image::show2.png[]


=== iOS 前端Swift一键使用
image::https://github.com/birdmichael/app-version-swift/raw/master/show.png[]
* 一键配置
* 全截面自定义
* 自动版本比较
* 自动限制最低版本
* 自动维护每次弹出,弹出一次逻辑
* 配置文本框最大高度(默认不可滚动,不显示滚动条)

#### 使用

```ruby
pod 'app-version-swift'
```

#### 注册
下面是配合后台,直接使用配套后台,或者协商字段一样。否则可以使用下面自定义接方法

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// 自定义配置
var config = AppVersionConfig()
config.layoutCompletionBlock = { alert in
alert.updateButton.setTitle("升级", for: .normal)
}
/// api 自行替换接口地址
AppVersion.registerApp(appId: "interbullion", serverUrl: "....api....", config: nil)
return true
}
```

##### 自定义接口
请求接口后,自己创建数据,直接进行弹窗。内部会做版本比对,或者更新类型判断
```swift
// 自定义接口请求
let data = VersionData(allowLowestVersion: "0", version: "1.0", forceUpdate: .must, description: "测试")
AppVersion.showAlert(parameters: data, config: nil)
```


类型说明:

```
public enum VersionUpdateType: Int, Codable {
/// 强制更新 (没有关闭按钮,每次启动弹出提示)
case must = 0
/// 一般更新 (有关闭按钮,每次启动弹出提示)
case nomal = 1
/// 静默更新 (有关闭按钮,不弹出提示)
case silent = 2
/// 忽略更新 (有关闭按钮,并且当前版本只弹出一次)
case ignore = 3
/// 静默忽略更新 (和忽略更新一样,有关闭按钮,并且不弹出提示)
case silentIgnore = 4
}
```


=== 答疑帮助

* 链接地址对的,但是请求返回 <没有权限访问该地址,请先登录> 提示信息?
Expand Down