From 12ce2b3162e6983db15d069840a1d5b82f63319a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mro=CC=81z?= Date: Mon, 11 Feb 2019 09:54:24 +0100 Subject: [PATCH] [Docs] Update AccessTokenPlugin init w/ autoclosure now --- docs/Authentication.md | 2 +- docs_CN/Authentication.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Authentication.md b/docs/Authentication.md index d6c96cf97..4754db330 100644 --- a/docs/Authentication.md +++ b/docs/Authentication.md @@ -42,7 +42,7 @@ There are two steps required to start using an `AccessTokenPlugin`. 1. You need to add an `AccessTokenPlugin` to your `MoyaProvider` like this: ```Swift let token = "eyeAm.AJsoN.weBTOKen" -let authPlugin = AccessTokenPlugin(tokenClosure: token) +let authPlugin = AccessTokenPlugin { token } let provider = MoyaProvider(plugins: [authPlugin]) ``` The `AccessTokenPlugin` initializer accepts a `tokenClosure` that is responsible diff --git a/docs_CN/Authentication.md b/docs_CN/Authentication.md index 0f806f24d..0f57efe71 100644 --- a/docs_CN/Authentication.md +++ b/docs_CN/Authentication.md @@ -40,7 +40,7 @@ Moya提供一个 `AccessTokenPlugin` 来完成 ```Swift let token = "eyeAm.AJsoN.weBTOKen" -let authPlugin = AccessTokenPlugin(tokenClosure: token) +let authPlugin = AccessTokenPlugin { token } let provider = MoyaProvider(plugins: [authPlugin]) ```