Giter Site home page Giter Site logo

krzysztofzablocki / kznodes Goto Github PK

View Code? Open in Web Editor NEW
336.0 336.0 21.0 3.79 MB

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

Home Page: http://twitter.com/merowing_

License: MIT License

Objective-C 96.13% Ruby 0.96% C 0.72% Shell 2.19%

kznodes's Introduction

Hi there πŸ‘‹

I am Principal engineer and creator of apps and tools that are trusted by over 80,000 teamsβ€”including industry leaders Apple, Disney, and Airbnb.

I've just released a video course that you can join if you want to save lots of time creating apps for Apple platforms.

πŸš€ I'm available for consulting and speaking engagements. Feel free to reach out to me to discuss opportunities.

In the past, I led iOS development at The New York Times, worked on apps such as Headspace, The Browser Company, and created my own indie apps like Foldify.

Community Work

You can sponsor my work and get premium content on my blog.

My Expertise

I focus on creating maintainable architecture and improving developer experience and efficiency by:

  • πŸ€” Designing flexible architecture that is easy to maintain
  • βš™οΈ Creating automation for common code tasks and workflows
  • πŸ‘₯ Establishing best practices for architecture, testing, and workflows
  • πŸ“‹ As a consultant, I usually:
    • πŸ€” Perform code reviews for entire projects and provide clients with practical recommendations to improve their team efficiency and satisfaction (through better development experience and automation)
    • πŸ‘₯ Help establish best practices and provide architecture recommendations
    • πŸ› οΈ Design and implement flexible and pragmatic solutions for hard problems
  • πŸ§™ And much more...

Talking with Me

  • 🐦 My Twitter: @merowing_
  • πŸ’¬ Pronouns: He/Him

You can learn more about me and my past experience on my blog.

kznodes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kznodes's Issues

More notes or comments please.

Not to sound critical as I appreciate this is open source, but the code is very difficult to decipher for someone who's never seen it. More comments or a document of the architecture would be of immense help. For example the following was really confusing so I added some comments and indenting:

[KZNNodeType registerType:name inputs:@{ @"Image" : CIImage.class } outputs:@{ @"Output" : CIImage.class } processingBlock:^(id node, NSDictionary *inputs, NSMutableDictionary *outputs)
        {
            //processing Block definition
            //processing block only is called from evaluateWithTick:(..)
            
            // WHY NOT CIImage *image = [CIImage new]; ???
            // probably because image already has data since it is from an input socket
            CIImage *image = inputs[@"Image"];
              if (!image) {
                return;
              }
            
            // create a filter object with the input image:
            //Note in the following the list of key value pairs is "kCIInputImageKey, image, nil" where nil is the end of the list
            CIFilter *filter = [CIFilter filterWithName:filterName
                                       keysAndValues:kCIInputImageKey, image, nil];
            //apply the filter and set the output image returned:
            CIImage *outputImage = [filter outputImage];
            outputs[@"Output"] = outputImage;
        }
         ];

The above has two sets of paramaters named "inputs" and "outputs" (one for the method and one for the block) so I easily confused that inputs and outputs used in the block was the same as that for the method. That made the code appear incorrect per the line:

CIImage *image = inputs[@"Image"];

Because I thought inputs was: @{ @"Image" : CIImage.class } which would make
CIImage *image = CIImage.class which would not work.

Next you have 3 versions of the method registerType:
The first version does nothing more than call the second version having the param:
withClass:KZNNode.class
But you are calling this second version many times within KZPlaygroundExample.m so why have this first version?

In the third version of the registerType method you have the line:
self.nodeTypes[typeName] = type;

where nodeTypes is not actually a dictionary as it would appear at a glance, but is a class method that returns a dictionary. This line is actually "registering" the type. The whole method is creating and registering the type. KZNNodeType it appears is not just a type of node but is also serving as a registry and factory of types and in addition a factory of nodes.

Here is the definition of the class method but where I'm at now is trying to understand what it is doing exactly? (update: I'm thinking that this was a work around for Objective-C not supporting class properties until Xcode 8, correct me if I'm wrong):

+ (NSMutableDictionary *)nodeTypes
{
  NSMutableDictionary *nodeTypes = objc_getAssociatedObject(self, kNodeTypesKey);
  if (!nodeTypes) {
    nodeTypes = [NSMutableDictionary new];
  }
  objc_setAssociatedObject(self, kNodeTypesKey, nodeTypes, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
  return nodeTypes;
}

In the project there are pod dependencies: KZPlayground, NHBalancedFlowLayout, RSSwizzle, and dyci. From their names I can guess what they are for, but some documentation of where, why and how much they are used in the project would be of help. When I looked at this project initially I had no idea that it used your own version of a Playground.

I'm still wondering why the project is seeming to use Class or why it needs it unless the plan were to do some runtime injection of classes.

I may add more comments to this as I proceed. The UI concept of nodes and sockets and connections seems too tightly coupled to the graph data model of same.

iPad - crash on start iOS 11

Building in Xcode 9. Runs fine in simulator but crashes when run on device.

Backtrace:

2017-11-02 13:24:19.857751+0000 KZNodes[387:21044] [DYMTLInitPlatform] platform initialization successful
2017-11-02 13:24:19.872168+0000 KZNodes[387:20887] *** Assertion failure in void swizzle(__unsafe_unretained Class, SEL, __strong RSSwizzleImpFactoryBlock)(), /Users/drh/dev/KZNodes/Example/Pods/RSSwizzle/RSSwizzle/RSSwizzle.m:190
2017-11-02 13:24:19.872381+0000 KZNodes[387:20887] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Selector performInjectionWithClass: not found in instance methods of class SFDynamicCodeInjection.'
*** First throw call stack:
(0x181b9a2d4 0x180de4528 0x181b9a1a8 0x18252e7fc 0x10076d178 0x10076cd84 0x100761e28 0x180de69cc 0x180de7a84 0x1007ce170 0x1007dece8 0x1007ddd40 0x1007dddfc 0x1007ce5e4 0x1007d3320 0x1007cd21c)
libc++abi.dylib: terminating with uncaught exception of type NSException

screen shot 2017-11-02 at 13 26 32

nicer curves

Nice work! πŸ‘ I've been building something similar on the web side: the-graph. Currently SVG-based, but I'm refactoring now to try to make it faster with more Canvas.

I put some work into making nice default bezier curves. If you like them, feel free to port to KZNodes.

screen shot 2014-11-06 at 12 19 29 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.