• Stars
    star
    336
  • Rank 125,564 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 10 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Have you ever wonder how you could make Origami like editor in 1h ?

KZNodes - editors like Origami made easy.

Version License Platform

Watch demo

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:

  • Domain agnostic, can be used to create editors for:
    • Animations
    • 3D Graphics
    • Image processing
    • Data Processing
    • Artificial Inteligence
    • Anything that you can express as a data / function pipeline?
  • Sockets have data types, you specify what classes are supported, that way you never get unsupported connections.
  • Fully native with 0 dependencies
  • Slick looking out of the box
  • Ultra simple to create new node classes, want to add class that can be used to apply sqrtf to it's input? 3 lines of code.

NodeType creation

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]));
  }];
  • sqrtf is the name
  • it has input socket "Input" that accepts NSNumbers
  • it has output socket "Output" that generates NSNumbers
  • Output = sqrtf(input)

There are also 2 more advanced creator functions:

  1. KZNNodeType withClass allows you to change base class used for a node, eg. use node with slider.
  2. KZNNodeType withBuilder allows you to use builder pattern instead of simplified syntax.

Setup block

You can also add setup block which will allow you to further configure new instances of your NodeType, eg. disable continuous slider.

Node evaluation mode

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.

Built-in node classes

KZNNodeWithSlider

KZNNodeWithText

Adding new node classes

It's simple:

  1. Create a subclass of KZNNode
  2. Do whatever you want with it
  3. when you register Node type you can specify your class as baseClass, and reference it in processingBlock.

Installation and setup

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.

Roadmap & Contributing

  • Serialization of workspaces.
  • Idiot-proofing.
  • Lazy evaluation of sockets.

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.

Changelog

0.1.1

  • much nicer bezier curves, based on the-graph

0.1.0

  • initial release

License

KZNodes is available under the MIT license. See the LICENSE file for more info.

Author

Krzysztof Zablocki, [email protected]

Follow me on twitter.

Check-out my blog or GitHub profile for more cool stuff.

More Repositories

1

Sourcery

Meta-programming for Swift, stop writing boilerplate code.
Swift
7,677
star
2

LifetimeTracker

Find retain cycles / memory leaks sooner.
Swift
3,144
star
3

Playgrounds

Better playgrounds that work both for Objective-C and Swift
Objective-C
2,633
star
4

Inject

Hot Reloading for Swift applications!
Swift
2,127
star
5

Swift-Macros

A curated list of awesome Swift Macros
Swift
2,120
star
6

Bootstrap

iOS project bootstrap aimed at high quality coding.
Objective-C
2,047
star
7

LineDrawing

Beatiful and fast smooth line drawing algorithm for iOS - as seen in Foldify.
Objective-C
1,288
star
8

Difference

Simple way to identify what is different between 2 instances of any type. Must have for TDD.
Swift
1,217
star
9

PropertyMapper

Property mapping for Objective-C iOS apps.
Objective-C
1,124
star
10

KZFileWatchers

A micro-framework for observing file changes, both local and remote. Helpful in building developer tools.
Swift
1,078
star
11

LinkedConsole

Clickable links in your Xcode console, so you never wonder which class logged the message.
Swift
931
star
12

Traits

Modify your native iOS app in real time.
Swift
904
star
13

IconOverlaying

Build informations on top of your app icon.
Shell
650
star
14

crafter

Crafter - Xcode project configuration CLI made easy.
Ruby
547
star
15

Strongify

Strongify is a 1-file µframework providing a nicer API for avoiding weak-strong dance.
Swift
444
star
16

SFObservers

NSNotificationCenter and KVO auto removal of observers.
Objective-C
307
star
17

AutomaticSettings

Data driven settings UI generation.
Swift
302
star
18

CCNode-SFGestureRecognizers

Adding UIGestureRecognizers to cocos2d, painless.
Objective-C
202
star
19

DetailsMatter

Objective-C
199
star
20

Pinch-to-reveal

Pinch to reveal animation transition built with Layer masking, as seen in boeing app for iPad.
Objective-C
192
star
21

ViewModelOwners

Protocols that help make your MVVM setup more consistent
Swift
143
star
22

KZAsserts

Asserts on roids, test all your assumptions with ease.
Objective-C
100
star
23

OhSnap

Reproduce bugs your user saw by capturing and replaying data snapshots with ease.
Swift
89
star
24

Versionable

Migration for `Codable` objects.
Swift
83
star
25

SFContainerViewController

UIViewControllers containment predating Apple implementation. Works in both 4.x and 5.x iOS, no memory or hierarchy issues.
Objective-C
82
star
26

Swift-Observable

Native KVO like behaviour build in Swift.
Swift
64
star
27

BehavioursExample

Objective-C
58
star
28

SourceryWorkshops

Swift
45
star
29

Learn-iOS-GameDev-Level-0

Teeter clone accompanying tutorial at http://merowing.info/2013/04/learn-ios-game-dev-level-0/
Objective-C
24
star
30

XibReferencing

Simple category and sample showing how you can reference one Xib view from another
Objective-C
20
star
31

KZImageSplitView

Objective-C
17
star
32

NSObject-SFExecuteOnDealloc

A simple category on NSObject that allows you to execute block when object is deallocated
Objective-C
17
star
33

jenkins_jobs_to_statusboard

Ruby script that generates html table for embedding in StatusBoard by Panic http://panic.com/statusboard/
Ruby
15
star
34

SourceryPro-Feedback

Repository for discussing https://merowing.info/sourcery-pro/
12
star
35

krzysztofzablocki

2
star
36

krzysztofzablocki.github.io

Blog
HTML
2
star
37

starter-hugo-academic

Jupyter Notebook
1
star