Giter VIP home page Giter VIP logo

Comments (6)

nicholascross avatar nicholascross commented on June 14, 2024

I am not a core contributor just a user of this framework. For those of us not familiar with libextobjc and ETXScope it might be helpful to elaborate on exactly what is not working. An example would also be helpful, from your the issue title it is not even clear that SpriteKit-Components is actually at fault.

from spritekit-components.

alexruperez avatar alexruperez commented on June 14, 2024

Sorry, I put this quickly and certainly is not very clear. The library libextobjc #define onExit, so that clashes with your onExit method.

This library is used usually because of @weakify(self)

I would be interested to have both in my project, you could rename those methods? Want me to do it on a pull request for your comfort?

Thanks! :)

from spritekit-components.

nicholascross avatar nicholascross commented on June 14, 2024

Okay I see what you mean, I am using ReactiveCocoa which also has these extensions, and it just so happens onExit isn't a component method I have had to use in any conflicting scenario. As these frameworks become more popular this problem will only increase.

I assume the only way to avoid this would be to rename onExit method? Doing so would be an API breaking change, and would do so without any direct trace, existing onExit code would just be never called.

If the change is accepted my vote would be to rename both onExit and onEnter selectors for the sake of consistency. Perhaps onExitScene/onEnterScene would be a good name.

We should definitely highlight this change in the README.md also.

from spritekit-components.

alexruperez avatar alexruperez commented on June 14, 2024

Fixed! :) Check it out! #10

from spritekit-components.

levilansing avatar levilansing commented on June 14, 2024

I agree with @nacrossweb and wouldn't want to change the API requiring everyone to refactor their projects unless it really makes sense, especially since it already mirrors cocos2d with which a lot of devs are already familiar.

We could define a preprocessor macro for a compatibility mode (such as SKC_COMPATIBILITY) that when enabled in the build settings will change onExit to onExitScene, and onEnter to onEnterScene.

It will make the code a little messy with some extra macros or ifdefs, but won't require everyone using the library to refactor all their projects with the next update. Thoughts?

from spritekit-components.

alexruperez avatar alexruperez commented on June 14, 2024

Good solution, thank you very much! 👍 @nacrossweb @levilansing @buddingmonkey

from spritekit-components.

Related Issues (4)

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.