<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          WAAccountStore賬號管理

          聯(lián)合創(chuàng)作 · 2023-09-27 15:51

          WAAccountStore 是一個簡單并且可擴展的賬號系統(tǒng)。它封裝了基本的賬號管理函數(shù),帳戶憑據(jù)的安全存儲,允許你存儲任何關(guān)于賬號的有用信息。

          使用示例:

          使用你 App 的默認存儲

          WAAccountStore.defaultStore()

          或許你想直接使用 WAAccountStore 。不過,WAAccountCredentialWAAccount 創(chuàng)建一些簡單的擴展可以讓你的工作更輕松。

          例如:

          將你的用戶模塊和 WAAccount 聯(lián)結(jié)

          //Assuming `User` is your user model class.
          extension WAAccount {
              var user: User {
                  get {
                      return self.userInfo as! User
                  }
              }
              convenience init(identifier: String, credential: WAAccountCredential, user: User) {
                  self.init(identifier: identifier, credential: credential, userInfo: user)
              }
          }

          直接進入 WAAccountCredential 的 securityStorage 不太方便,所以先創(chuàng)建一個方便進入的擴展。

          let UserAccessTokenStorageKey = "AccessToken"
          extension WAAccountCredential {
              var accessToken: String {
                  get {
                      return self.securityStorage[UserAccessTokenStorageKey] as! String
                  }
              }
              convenience init(identifier: String, accessToken: String) {
                  self.init(identifier: identifier, securityStorage: [UserAccessTokenStorageKey: accessToken])
              }
          }


          瀏覽 24
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  精品久久ai | 影音先锋在线看片av一区 | 小黄片免费视频 | 无码一区二区三区嫩草网你懂的 | 久久手机黄片 |