MalKit 0.0.9

MalKit 0.0.9

测试已测试
Lang语言 SwiftSwift
许可证 MIT
发布最后发布Aug 2017
SwiftSwift 版本3.0
SPM支持 SPM

Maintained by nktn.



MalKit 0.0.9

  • By
  • nktn

MalKit

====

描述

MyAnimeList(官方API)的Swift API客户端

https://myanimelist.net/modules.php?go=api

要求

Xcode8.3.X(Swift3)

使用方法

设置(MyAnimeList账户用于请求API)

import MalKit

MalKit().setUserData(userId: "xxxxxx", passwd: "yyyyyy")

搜索示例

MalKit().searchAnime("naruto", completionHandler: { (items, status, err) in
    //result is Data(XML). You need to parse XML.
    //your process
})
MalKit().searchManga("naruto", completionHandler: { (items, status, err) in
    //result is Data(XML). You need to parse XML.
    //your process
})

添加或更新您列表中的动漫/漫画。有关更多信息,请参阅此处 (动漫参数)。对于漫画,请参阅此处

添加示例

MalKit().addAnime(20, params:["status": 1], completionHandler: { (result, status, err) in
     //20 is anime_id
     //result is Bool
     //your process
})
MalKit().addManga(20, params:["status": 1], completionHandler: { (result, status, err) in
     //20 is manga_id
     //result is Bool
     //your process
})

更新示例

MalKit().updateAnime(20, params:["status": 0, "comments": "test"], completionHandler: { (result, status, err) in
     //20 is anime_id
     //result is Bool
     //your process
})
MalKit().updateManga(20, params:["status": 0, "comments": "test"], completionHandler: { (result, status, err) in
     //20 is manga_id
     //result is Bool
     //your process
})

删除示例

MalKit().deleteAnime(20, completionHandler: { (result, status, err) in
      //20 is anime_id
      //result is Bool
     //your process
})
MalKit().deleteManga(20, completionHandler: { (result, status, err) in
      //20 is manga_id
      //result is Bool
     //your process
})

验证凭据示例

MalKit().verifyCredentials(completionHandler: { (result, status, err) in
     //result is Data(XML). You need to parse XML.
     //your process
})

安装

Cartfile

github "nktn/MalKit"

carthage update

Podfile

pod 'MalKit'

pod install

许可证

MIT

作者

nktn