CBLDictionary
@protocol CBLDictionary <NSObject, CBLDictionaryFragment, NSFastEnumeration>CBLDictionary protocol defines a set of methods for reading dictionary data.
- 
                  
                  The number of entries in the dictionary. DeclarationObjective-C @property (readonly, nonatomic) NSUInteger count;Swift var count: UInt { get }
- 
                  
                  An array containing all keys, or an empty array if the dictionary has no entries. DeclarationObjective-C @property (readonly, copy, nonatomic) NSArray<NSString *> *_Nonnull keys;Swift var keys: [String] { get }
- 
                  
                  Gets a property’s value. The object types are CBLBlob, CBLArray, CBLDictionary, NSNumber, or NSString based on the underlying data type; or nil if the property value is NSNull or the property doesn’t exist. DeclarationObjective-C - (nullable id)valueForKey:(nonnull NSString *)key;Swift func value(forKey key: String) -> Any?ParameterskeyThe key. Return ValueThe object value or nil. 
- 
                  
                  Gets a property’s value as a string. Returns nil if the property doesn’t exist, or its value is not a string. DeclarationObjective-C - (nullable NSString *)stringForKey:(nonnull NSString *)key;Swift func string(forKey key: String) -> String?ParameterskeyThe key. Return ValueThe NSString object or nil. 
- 
                  
                  Gets a property’s value as a number. Returns nil if the property doesn’t exist, or its value is not a number. DeclarationObjective-C - (nullable NSNumber *)numberForKey:(nonnull NSString *)key;Swift func number(forKey key: String) -> NSNumber?ParameterskeyThe key. Return ValueThe NSNumber object or nil. 
- 
                  
                  Gets a property’s value as an integer value. Floating point values will be rounded. The value trueis returned as 1,falseas 0. Returns 0 if the property doesn’t exist or does not have a numeric value.DeclarationObjective-C - (NSInteger)integerForKey:(nonnull NSString *)key;Swift func integer(forKey key: String) -> IntParameterskeyThe key. Return ValueThe integer value. 
- 
                  
                  Gets a property’s value as a long long value. Floating point values will be rounded. The value trueis returned as 1,falseas 0. Returns 0 if the property doesn’t exist or does not have a numeric value.DeclarationObjective-C - (long long)longLongForKey:(nonnull NSString *)key;Swift func longLong(forKey key: String) -> Int64ParameterskeyThe key. Return ValueThe long long value. 
- 
                  
                  Gets a property’s value as a float value. Integers will be converted to float. The value trueis returned as 1.0,falseas 0.0. Returns 0.0 if the property doesn’t exist or does not have a numeric value.DeclarationObjective-C - (float)floatForKey:(nonnull NSString *)key;Swift func float(forKey key: String) -> FloatParameterskeyThe key. Return ValueThe float value. 
- 
                  
                  Gets a property’s value as a double value. Integers will be converted to double. The value trueis returned as 1.0,falseas 0.0. Returns 0.0 if the property doesn’t exist or does not have a numeric value.DeclarationObjective-C - (double)doubleForKey:(nonnull NSString *)key;Swift func double(forKey key: String) -> DoubleParameterskeyThe key. Return ValueThe double value. 
- 
                  
                  Gets a property’s value as a boolean. Returns YES if the value exists, and is either trueor a nonzero number.DeclarationObjective-C - (BOOL)booleanForKey:(nonnull NSString *)key;Swift func boolean(forKey key: String) -> BoolParameterskeyThe key. Return ValueThe boolean value. 
- 
                  
                  Gets a property’s value as an NSDate. JSON does not directly support dates, so the actual property value must be a string, which is then parsed according to the ISO-8601 date format (the default used in JSON.) Returns nil if the value doesn’t exist, is not a string, or is not parseable as a date. NOTE: This is not a generic date parser! It only recognizes the ISO-8601 format, with or without milliseconds. DeclarationObjective-C - (nullable NSDate *)dateForKey:(nonnull NSString *)key;Swift func date(forKey key: String) -> Date?ParameterskeyThe key. Return ValueThe NSDate object or nil. 
- 
                  
                  Get a property’s value as a CBLBlob. Returns nil if the property doesn’t exist, or its value is not a CBLBlob. DeclarationObjective-C - (nullable CBLBlob *)blobForKey:(nonnull NSString *)key;Swift func blob(forKey key: String) -> CBLBlob?ParameterskeyThe key. Return ValueThe CBLBlob object or nil. 
- 
                  
                  Get a property’s value as a CBLArray, which is a mapping object of an array value. Returns nil if the property doesn’t exists, or its value is not an array. DeclarationObjective-C - (nullable CBLArray *)arrayForKey:(nonnull NSString *)key;Swift func array(forKey key: String) -> CBLArray?ParameterskeyThe key. Return ValueThe CBLArray object or nil. 
- 
                  
                  Get a property’s value as a CBLDictionary, which is a mapping object of a dictionary value. Returns nil if the property doesn’t exists, or its value is not a dictionary. DeclarationObjective-C - (nullable CBLDictionary *)dictionaryForKey:(nonnull NSString *)key;Swift func forKey(_ key: String) -> CBLDictionary?ParameterskeyThe key. Return ValueThe CBLDictionary object or nil. 
- 
                  
                  Tests whether a property exists or not. This can be less expensive than -valuetForKey:, because it does not have to allocate an NSObject for the property value. DeclarationObjective-C - (BOOL)containsValueForKey:(nonnull NSString *)key;Swift func containsValue(forKey key: String) -> BoolParameterskeyThe key. Return ValueThe boolean value representing whether a property exists or not. 
- 
                  
                  Gets content of the current object as an NSDictionary. The value types of the values contained in the returned NSArray object are CBLBlob, NSArray, NSDictionary, NSNumber, NSNull, and NSString. DeclarationObjective-C - (nonnull NSDictionary<NSString *, id> *)toDictionary;Swift func toDictionary() -> [String : Any]Return ValueThe NSDictionary object representing the content of the current object. 
 CBLDictionary Protocol Reference
        CBLDictionary Protocol Reference