TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Feb 2017 |
Maintained by Krzysztof Zablocki, Krzysztof Zabłocki.
Have you ever wondered how you could create an editor like Origami? How about creating a subset of Origami in less than 100 lines of code?
Joining nodes is like functional programming, only visual.
Features:
Think of NodeTypes like objc classes, they define common behaviour for all instances. You can create a new node class as follows:
[KZNNodeType registerType:@"sqrtf" inputs:@{ @"Input" : NSNumber.class } outputs:@{ @"Output" : NSNumber.class } processingBlock:^(KZNNode *node, NSDictionary *inputs, NSMutableDictionary *outputs) {
outputs[@"Output"] = @(sqrtf([inputs[@"Input"] floatValue]));
}];
Output = sqrtf(input)
There are also 2 more advanced creator functions:
You can also add setup block which will allow you to further configure new instances of your NodeType, eg. disable continuous slider.
Nodes are lazy evaluated by default, they will only evaluate when there is a change on their sockets or connected nodes. Changes propagate to connections, so if you modify a node in the beginning of a graph it will propagate to all connected nodes.
If you mark node type to use continuous evaluation, it will evaluate 60 times per second if possible, eg. time node in sample app.
It's simple:
KZNodes is distributed as a CocoaPod:
pod 'KZNodes'
so you can either add it to your existing project or clone this repository and play with it.
Pull-requests are welcomed.
It took me around 18h to get from idea to release so the code is likely to change before 1.0 release.
If you'd like to get specific features I'm available for iOS consulting.
KZNodes is available under the MIT license. See the LICENSE file for more info.
Krzysztof Zablocki, [email protected]
Check-out my blog or GitHub profile for more cool stuff.