• Stars
    star
    453
  • Rank 92,903 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Auto reflection tool from JSON to Model, user friendly JSON encoder / decoder, aims to never die

JSONNeverDie is an auto reflection tool from JSON to Model, a user friendly JSON encoder / decoder, aims to never die. Also JSONNeverDie is a very important part of Pitaya.

Example

set up a Model:

class People: JSONNDModel {
    @objc var name = ""
}

reflex JSON to Model automatic:

let json = JSONND(string: "{\"name\": \"JohnLui\"}")
let people = People(JSONNDObject: json)
print(people.name)

Features

reflection features

  • JSON to Model reflection automatic
  • auto reflection with no need of init()
  • supports multi-level reflection

JSON encode / decode features

  • supports all types: Int, Double, Bool, String, Array
  • user friendly: Xcode can prompt all available types
  • provides both Optional-type(Int?) and Original-type(Int)

And JSONNeverDie is well tested.

Requirements

  • iOS 7.0+
  • Swift 4 (Version 3) in current swift4 branch
  • Swift 3 (Version 2) in swift3 branch
  • Swift 2.x / Xcode 7 (Version 1.x) in master branch

##Contribution

You are welcome to fork and submit pull requests.

##License

JSONNeverDie is open-sourced software licensed under the MIT license.

中文介绍

基本示例

构建一个 Model:

class People: JSONNDModel {
    @objc var name = ""
}

从字符串转换成 JSON 再自动映射为 Model:

let json = JSONND(string: "{\"name\": \"JohnLui\"}")
let people = People(JSONNDObject: json)
print(people.name)

参与开源

欢迎提交 issue 和 PR,大门永远向所有人敞开。

开源协议

本项目遵循 MIT 协议开源,具体请查看根目录下的 LICENSE 文件。

More Repositories

1

Learn-Laravel-5

Laravel 5 系列入门教程
PHP
3,511
star
2

PPHC

📙《高并发的哲学原理》开源图书(CC BY-NC-ND)
Rust
2,666
star
3

SwiftSideslipLikeQQ

再造 “手机QQ” 侧滑菜单
Swift
1,670
star
4

AutoLayout

Auto Layout 秘境
Swift
1,216
star
5

Pitaya

🏇 A Swift HTTP / HTTPS networking library just incidentally execute on machines
Swift
845
star
6

SwiftNotice

GUI library for displaying various popups (HUD), written in pure Swift.
Swift
839
star
7

AliyunOSS

阿里云 OSS 官方 SDK 的 Composer 封装,支持任何 PHP 项目,包括 Laravel、Symfony、TinyLara 等等。
PHP
487
star
8

Swift-MMP

🎧 Stream Material-design Music Player written by Swift for iOS.
Swift
367
star
9

Swift-On-iOS

JohnLui 的 Swift On iOS 代码仓库
Swift
350
star
10

FireUpYourVPN

在通知中心一键启用 VPN
Swift
310
star
11

Learn-Laravel-4

Laravel 4 系列入门教程 代码示例
PHP
215
star
12

DIYSearchEngine

🔍 Go 开发的开源互联网搜索引擎,附教程《自己动手开发互联网搜索引擎》
Go
135
star
13

My-First-Framework-based-on-Composer

利用 Composer 一步一步构建自己的 PHP 框架 代码示例
PHP
111
star
14

LaraDuoshuo

Laravel 5 实现的私有评论系统,用于 Hexo、Jekyll 等静态博客系统
PHP
92
star
15

CodeIgniter-2-with-Eloquent

CodeIgniter 2.2.0 with Eloquent
PHP
42
star
16

MarkDown-for-Emlog

十分漂亮的 Markdown 编辑器,完美替代 Emlog 自带编辑器。
JavaScript
36
star
17

AliyunOSS-Laravel7

阿里云 OSS 官方 SDK 的 Composer 封装,专门支持 Laravel 7、Laravel 8
PHP
32
star
18

go_static

A simple static tool for any single page with golang, also can be used in Emlog platform for the whole website. 使用Go语言编写的跨平台的网站首页静态化工具[也适用于emlog整站(首页+文章+页面)静态化]
Go
26
star
19

KillTYZ

KillTYZ 干掉拖延症
PHP
23
star
20

JSON-API-for-Emlog

强大的 JSON 格式的数据输出插件,为 Emlog 而生。
PHP
6
star
21

GraphQL-Laravel

A Laravel GraphQL reference implementation forked from webonyx/graphql-php
PHP
3
star
22

Ultimo-emlog

Ultimo 主题 for Emlog
PHP
2
star
23

Change

a Emlog template
PHP
1
star
24

PHPSwift

Write Swift like PHP, just for fun.
Swift
1
star