ReaderHive/ReaderHive/Base/Extension/Dictionary+NRAdd.swift
2025-12-17 18:04:38 +08:00

24 lines
421 B
Swift

//
// Dictionary+NRAdd.swift
// ReaderHive
//
// Created by on 2025/12/10.
//
import UIKit
extension Dictionary {
func toJsonString() -> String? {
do {
let data = try JSONSerialization.data(withJSONObject: self)
let jsonStr = String(data: data, encoding: .utf8)
return jsonStr
} catch {
}
return nil
}
}