amap_map/ios/Classes/Util/AMapJsonUtils.h

36 lines
903 B
Objective-C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// MAJsonUtils.h
// amap_map
//
// Created by shaobin on 2019/2/13.
// Copyright © 2019 Amap.com. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface AMapJsonUtils : NSObject
/**
model转为可序列化为json的对象。
@param model model对象:支持NSDictionary、NSArray、自定义类且支持嵌套(Dict、Array内包含自定义类示例或自定义类内包含Dict、Array) 注意如果自定义类或dict、array中包含非字符串、数字、布尔、null类型的属性其行为是undefined的
@return 返回NSArray或者NSDictionary对象如果失败返回nil。
*/
+ (id)jsonObjectFromModel:(id)model;
/**
dict转model
@param dict dict
@param modelClass model对应的Class
@return 返回modelClass实例
*/
+ (id)modelFromDict:(NSDictionary*)dict modelClass:(Class)modelClass;
@end
NS_ASSUME_NONNULL_END