Skip to content

Commit 1dcf32d

Browse files
committed
完成SmartLossy开发
1 parent 4e06f93 commit 1dcf32d

14 files changed

Lines changed: 85 additions & 32 deletions

File tree

Example/SmartCodable/1231231.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// 1231231.swift
33
// SmartCodable_Example
44
//
5-
// Created by qixin on 2024/9/26.
5+
// Created by Mccc on 2024/9/26.
66
// Copyright © 2024 CocoaPods. All rights reserved.
77
//
88

Example/SmartCodable/Smart/1.Introduce(使用介绍)/Introduce_12ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Introduce_12ViewController.swift
33
// SmartCodable_Example
44
//
5-
// Created by qixin on 2024/9/26.
5+
// Created by Mccc on 2024/9/26.
66
// Copyright © 2024 CocoaPods. All rights reserved.
77
//
88

Example/SmartCodable/Smart/3.SmartLog(调试日志)/DecodingLogViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// DecodingLogViewController.swift
33
// SmartCodable_Example
44
//
5-
// Created by qixin on 2025/6/4.
5+
// Created by Mccc on 2025/6/4.
66
// Copyright © 2025 CocoaPods. All rights reserved.
77
//
88

Example/SmartCodable/Smart/4.Case(案例)/CaseEightViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// CaseEightViewController.swift
33
// SmartCodable_Example
44
//
5-
// Created by qixin on 2025/7/24.
5+
// Created by Mccc on 2025/7/24.
66
// Copyright © 2025 CocoaPods. All rights reserved.
77
//
88

Example/SmartCodable/TestViewController.swift

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,20 @@ class TestViewController: BaseViewController {
3232

3333
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
3434
let dict: [String: Any] = [
35-
"my_name": "Tom",
36-
// "nick_name": "XiaoMing",
37-
// "student": [
38-
// "my_age": "18"
39-
// ]
35+
"frinds": ["Tom", 1],
4036
]
4137

42-
guard let student = StudentModel.deserialize(from: dict) else { return }
43-
print("⭐️解析结果: my_name = \(student.flatModel.my_name), nick_name = \(student.flatModel.nick_name)")
38+
guard let student = Model.deserialize(from: dict) else { return }
39+
print("⭐️解析结果: my_name = \(student.frinds)")
4440
}
4541

46-
47-
struct StudentModel: SmartCodableX {
48-
@SmartFlat
49-
var flatModel: FlatModel = FlatModel()
50-
51-
}
52-
53-
struct FlatModel: SmartCodableX {
54-
@SmartIgnored
55-
var image: UIImage?
56-
var nick_name: String = "Mccc"
57-
var my_name: String = "default"
58-
}
5942

43+
struct Model: SmartDecodable {
44+
@SmartLossy
45+
var frinds: [Int] = []
46+
}
6047
}
6148

49+
50+
51+

Example/SmartCodable/平替HandyJSON/ReplaceHandyJSON_7ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ReplaceHandyJSON_7ViewController.swift
33
// SmartCodable_Example
44
//
5-
// Created by qixin on 2024/9/3.
5+
// Created by Mccc on 2024/9/3.
66
// Copyright © 2024 CocoaPods. All rights reserved.
77
//
88

Example/SmartCodable/测试用例/继承/TestInheritCaseViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// TestInheritCaseViewController.swift
33
// SmartCodable_Example
44
//
5-
// Created by qixin on 2025/5/6.
5+
// Created by Mccc on 2025/5/6.
66
// Copyright © 2025 CocoaPods. All rights reserved.
77
//
88

Example/Tests/Tests_Base.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Tests_Base.swift
33
// SmartCodable_Tests
44
//
5-
// Created by qixin on 2025/4/14.
5+
// Created by Mccc on 2025/4/14.
66
// Copyright © 2025 CocoaPods. All rights reserved.
77
//
88

Sources/SmartCodable/Core/JSONEncoder/SmartKeyEncodingStrategy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SmartKeyEncodingStrategy.swift
33
// SmartCodable
44
//
5-
// Created by qixin on 2024/9/26.
5+
// Created by Mccc on 2024/9/26.
66
//
77

88
import Foundation

Sources/SmartCodable/Core/PropertyWrapper/PropertyWrapperProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// PropertyWrapperProtocol.swift
33
// SmartCodable
44
//
5-
// Created by qixin on 2025/4/9.
5+
// Created by Mccc on 2025/4/9.
66
//
77

88
import Foundation

0 commit comments

Comments
 (0)