Accessing properties in a structure using the accessor ->.结构体访问符
@"...NSKeyPath->StructKey->StructKey";
Indexer
Provides a simple way to access array elements in key path.
Provides a simple way to access array elements in key path.
@[0] ; @[0,1] ;
Use the index symbol 'i' to find elements within the array range.
@[i <= 3 , i > 5];
Use the index symbol '!' You can exclude elements from an array.
@[!0,!1] ; @[i != 0 , i != 1] ; @[i<5 , 9] ; @[i<5 , !3] ;
Confirm elements and deny elements cannot exist at the same time.真假不能同时存在!
It's wrong : @[0,!1] ;
PathFunction
PathFunction is a custom NSKeyValueOperator.自定义路径函数
name
--------------------
@nslog
@isNSNull
@isAllEqual
@isAllDifferent
--------------------
Default behavior
When an unregistered method is called, the function name is called as selector name. Returns if there is a return value, if no returns the target itself.
id viewThatRemoved = [... akvc_valueForExtensionPath:@"view.@removeFromSuperview"];
It is legal to use a method with parameters, but it is not recommended. All parameters are the default values.
id mulArraySelf = [mulArray akvc_valueForExtensionPath:@"@removeObjectAtIndex:.@removeObjectAtIndex:"];
Equivalent ==>
[mulArray removeObjectAtIndex:0];
[mulArray removeObjectAtIndex:0];
id mulArraySelf = mulArray;
Subkey
Sub string of property key.
Expressions :<...>
`time` can match 'createTime' and 'modifyTime'.
[... akvc_valueForExtensionPath:@"...<time>.@isAllEqual"];
Regkey
Expressions of property key.
Expressions :<$...$>
`button\\d+` can match 'button0','button1', ...
[... akvc_setValue:@(YES) forExtensionPath:@"...<button\\d+>.hidden"];
SELInspector
If iSELInspector is the last component, it is equivalent to - respondsToSelector: .
PredicateEvaluate equates to - evaluateWithObject: . Refert to PredicateFilter
Expressions :@:PredicateString?
Component ...?
Class(...)?(ClassInspector), SEL(...)?(SELInspector),@:...? (PredicateEvaluate)
-All this component has this feafure : If it's not the last component, it will as a condition for whether to execute next path.While false it return nil or do noting, else execute next path.
在路径中时这类组件表示是否执行的条件,false时返回nil或者什么也不做,true时执行之后。
Regist custom struct
Register a custom struct need 2 method : + registStruct:getterMap: and + registStruct:setterMap:
Key of getter map or setter map is member name of structural
Value of getter map is a block like __kindof NSValue*(^GetBlockType)(NSValue* value)