|
| 1 | +// |
| 2 | +// DevGuideline |
| 3 | +// KakaJSON |
| 4 | +// |
| 5 | +// Created by MJ Lee on 2019/8/14. |
| 6 | +// Copyright © 2019 MJ Lee. All rights reserved. |
| 7 | +// |
| 8 | + |
| 9 | +/* |
| 10 | +Metadata Reference: |
| 11 | +0. https://github.com/apple/swift/blob/master/docs/ABI/TypeMetadata.rst |
| 12 | +1. https://github.com/apple/swift/blob/master/include/swift/ABI/MetadataKind.def |
| 13 | +2. https://github.com/apple/swift/blob/master/include/swift/ABI/Metadata.h |
| 14 | +3. https://github.com/apple/swift/blob/master/include/swift/ABI/MetadataValues.h |
| 15 | +4. https://github.com/apple/swift/blob/master/utils/dtrace/runtime.d |
| 16 | +5. https://github.com/apple/swift/blob/master/include/swift/Reflection/Records.h |
| 17 | +*/ |
| 18 | + |
| 19 | +1. 提交代码之前,请务必先保证在真机、模拟器上通过所有的测试用例(Debug+Release模式) |
| 20 | + |
| 21 | +2. 命名规范 |
| 22 | +① 给模型类型、系统自带类型,扩展public的成员 |
| 23 | +- obj.kj.成员名称 |
| 24 | +- 比如 "123".kj.numberCount, model.kj.JSON() |
| 25 | + |
| 26 | +② 给模型类型、系统自带类型,扩展internal的成员 |
| 27 | +- obj.kj_成员名称 |
| 28 | +- 比如 "123".kj_numberCount, model.kj_JSON() |
| 29 | + |
| 30 | +③ private\fileprivate的成员 |
| 31 | +- obj._成员名称 |
| 32 | +- 比如 "123"._numberCount, model._JSON() |
| 33 | + |
| 34 | +④ 类型名、方法名必须是大写的`JSON` |
| 35 | +- 不要写`json`, 也不要写`Json` |
| 36 | +- 如果是变量名、常量名、参数名,可以用小写`json` |
| 37 | + |
| 38 | +/**********************************************************/ |
| 39 | + |
| 40 | +1. Please make all test cases right before pushing your code |
| 41 | +- include iOS Device\Simulator |
| 42 | +- include release\debug mode |
| 43 | + |
| 44 | +2. NamingConvention |
| 45 | +① public extension for system types, model types |
| 46 | +- obj.kj.memberName |
| 47 | +- e.g. "123".kj.numberCount, model.kj.JSON() |
| 48 | + |
| 49 | +② internal extension for system types, model types |
| 50 | +- obj.kj_memberName |
| 51 | +- e.g. "123".kj_numberCount, model.kj_JSON() |
| 52 | + |
| 53 | +③ private\fileprivate |
| 54 | +- obj._memberName |
| 55 | +- e.g. "123"._numberCount, model._JSON() |
| 56 | + |
| 57 | +④ Name of method or type must be `JSON` |
| 58 | +- not `json`, not `Json` |
| 59 | +- name of variable can be `json` |
0 commit comments