1

I have look made some search, however could not find any information. Question is pretty straight-forward. I don't know if it is possible, but, in this link they could create a NSMenu item via xib files. So I thought maybe it is possible to create NSMenu using SwiftUI as well.

Faruk
  • 2,269
  • 31
  • 42
  • What are you trying to do with the NSMenu? – Taylor Nov 19 '19 at 06:24
  • 1
    :) I was trying to make NSMenu with using SwiftUI. I found a solution creating NSMenuItem using NSHostingController that initiates a SwiftUI class. Now I am just waiting for another way if there is any. – Faruk Nov 26 '19 at 13:32
  • 2
    Dude if u found an answer on ur question can u publish it? Do u understand that there is more than u who trying to find a solution. – NyanNyan Oct 17 '20 at 15:37
  • 1
    Not directly but you can check my prev comment @NyanNyan – Faruk Oct 17 '20 at 15:42
  • Still if you request futher explanation I will do it within 24 hours. @NyanNyan – Faruk Oct 17 '20 at 15:43
  • It will be pleasure if u publish a short answer, thank you) – NyanNyan Oct 19 '20 at 14:26

1 Answers1

-1

The answer for me was wrapping my desired SwiftUI view code using NSHostingView. Apple Docs

I can share the snippet, however it may take some time because I do not have laptop containing the project with me.

Faruk
  • 2,269
  • 31
  • 42