Code Monkey home page Code Monkey logo

Comments (12)

L1cardo avatar L1cardo commented on July 23, 2024 1

Ooooooop!
I just found that !!!
Now I win!!
Thanks for tonight's helping!!!

from touch-baer.

a2 avatar a2 commented on July 23, 2024

Hi @L1cardo, unfortunately the ability to forward declare undocumented methods is something you can only do in Objective-C. Apple has documentation on Obj-C / Swift interoperability. I hope this helps!

from touch-baer.

L1cardo avatar L1cardo commented on July 23, 2024

I really have no idea about what to do . :(
I think that importing an OC file to Swift requires a .m file , but there is only TouchBar.h, so I don't know which file to import and what to do after importing.
Could you please make it a little clear ?

from touch-baer.

a2 avatar a2 commented on July 23, 2024

This is all in the documentation, but you'll want to create and set up a "YourTarget-Bridging-Header.h" file and add #import "TouchBar.h" to it.

from touch-baer.

L1cardo avatar L1cardo commented on July 23, 2024

Which file in your project should I copy to my project?

This is all in the documentation, but you'll want to create and set up a "YourTarget-Bridging-Header.h" file and add #import "TouchBar.h" to it.

I have done that already.
Which file in your project should I copy to my project? All of them or just TouchBar.h

from touch-baer.

a2 avatar a2 commented on July 23, 2024

TouchBar.h should suffice. Don't forget to configure the Swift Bridging Header in your project's Build Settings.

image

from touch-baer.

L1cardo avatar L1cardo commented on July 23, 2024

thanks!
I will see what I can do !
Thanks again!

from touch-baer.

L1cardo avatar L1cardo commented on July 23, 2024

I have imported the file and I can use the func such as addSystemTrayItem, but it is really difficult for me to display an item on the touchbar.

  1. I dont know how to add an item on touchbar
  2. I am getting this error
    image

from touch-baer.

L1cardo avatar L1cardo commented on July 23, 2024

This is what I did
image

from touch-baer.

a2 avatar a2 commented on July 23, 2024

It's also possible that the symbol has been removed in macOS Catalina, if that's what you're using. I haven't tried it recently.

from touch-baer.

L1cardo avatar L1cardo commented on July 23, 2024

I can build and run your project, but not mine

from touch-baer.

a2 avatar a2 commented on July 23, 2024

Did you link against DFRFoundation.framework?

from touch-baer.

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.