FWDictionaryWrapper

@interface FWDictionaryWrapper<__covariant KeyType, __covariant ValueType>
    : FWObjectWrapper

Undocumented

FWSafeType

  • 安全读取对象(过滤NSNull)

    Declaration

    Objective-C

    - (nullable ObjectType)objectForKey:(nullable KeyType)key;

    Parameters

    key

    键名

    Return Value

    键值

FWFoundation

  • 过滤字典元素,如果block返回NO,则去掉该元素

    Declaration

    Objective-C

    - (nonnull NSDictionary<KeyType, ObjectType> *)filterWithBlock:
        (nonnull BOOL (^)(KeyType _Nonnull, ObjectType _Nonnull))block;
  • 映射字典元素,返回的obj重新组装成一个字典

    Declaration

    Objective-C

    - (nonnull NSDictionary *)mapWithBlock:
        (nonnull id _Nullable (^)(KeyType _Nonnull, ObjectType _Nonnull))block;
  • 匹配字典第一个元素,返回满足条件的第一个obj

    Declaration

    Objective-C

    - (nullable ObjectType)matchWithBlock:
        (nonnull BOOL (^)(KeyType _Nonnull, ObjectType _Nonnull))block;