macOS Swift Safari-like tabs

好久不见. 提交于 2019-12-10 11:34:21

问题


I want to add the tabbing mechanism that you can see e.g. in Safari, the Console or the Finder (http://dailymactips.com/working-with-finder-tabs-on-your-mac/). I have already searched a lot, but I can not find a good guide for this.

Ideally, I want to be able to push an alert-dialog before a new tab is created by the user.


回答1:


NSWindow has native tabs for a couple of years now.

The "Whats new in Cocoa" session from WWDC 2016 is the best place to start, since the documentation is quite thin still.

Whats New In Cocoa (203 WWDC 2016)

If you are using (for example) the method addTabbedWindow::ordered:, you can simply show your alert before adding the tab.



来源:https://stackoverflow.com/questions/48830321/macos-swift-safari-like-tabs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!