antoonio 0.6.5

antoonio 0.6.5

测试已测试
Lang语言 SwiftSwift
许可证 MIT
发布上次发布2017年10月
SwiftSwift 版本4
SPM支持 SPM

Anton Lindroth 维护。



antoonio 0.6.5

这是一个主要为我自己构建的框架。它包括我在每个项目中使用的某些函数。你只需要 import antoonio

一些功能

以下是框架中包含的一些主要功能的列表和说明。你可以在 文档 中了解更多。

JSON

它正是你所想的,也是 Swift 应该已经集成的内容。

llet json = JSON()
json["foo"].value = "bar"
json["users"].append(["username": "ntoonio", "country": "Sweden"])
json["users"].append(["username": "testUser", "country": "North Pole"])

let deepJSON = json["verry"]["deep"]["nested"]["dicts"]["are"]["pretty"]

deepJSON["cool"].bool = true
deepJSON["bad"].string = "sometimes"

print(deepJSON["cool"].toInt) // .to<type> converts the value "friendly"
print(deepJSON["cool"].int) // nil

print(json.prettyJSON)

Base64

添加了一些编码和解码 base64 的函数。例如

"Hello".base64Encoded
"SGVsbG8=".base64Decoded

UIImage().base64Encoded // Returns a string, ie. "SGVsbG8="
UIImage(base64String: "SGVsbG8=")

作者

Anton Lindroth (Github: @ntoonio, Twitter: @ntoon_io), [email protected]

许可证

antoonio 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。