macos 右键菜单自定义
If you’re a genius like me, you need many days of scouring the web and weeping in the night to learn new things like… Swift and SwiftUI.
如果您是像我这样的天才,则需要花费很多时间在网上搜寻和夜间哭泣,才能学习诸如Swift和SwiftUI之类的新事物。
In this little tutorial, we’ll learn to:
在这个小教程中,我们将学习:
- Create a nice little “image button” that calls a function you’ve passed to it. 创建一个漂亮的小“图像按钮”,以调用传递给它的函数。
- And shows the image in 32 x 32 no matter what the size of the image was. 并以32 x 32的分辨率显示图像,无论图像大小如何。
- And is dynamically colored with your own custom color. 并使用您自己的自定义颜色动态着色。
The end result is shown below. You click the button, and whatever function you passed to the view gets called. The blue you see is a custom blue.<