如何在Swift中使用文件系统事件API? [英] How to use the File System Events API in Swift?
问题描述
也许我的搜索字词今天不好,但我找不到一个简单的例子如何使用FSEvents在swift。
maybe my search terms are not good today, but i can't find a simple example how to use the FSEvents in swift.
我有一个可可应用程序显示文件中的内容。当文件在我的应用程序外更改,我必须标记重新加载按钮的另一种颜色。我的东西FSEvents是正确的地方寻找这个,或者我应该使用另一个API?
I have a cocoa application that displays contents from a file. When the file is changed outside of my application i have to mark the reload-button in another color. I thing FSEvents is the right place to look for this, or should I use another API?
你能给我一个例子,说明如何在文件更改内容时恢复活动?
Can you give me an example of how to revive an event when a file has changed the content?
非常感谢。
推荐答案
再次查找之后,我找到了这个小库,它也适用于文件:
https://github.com/Eonil/FileSystemEvents
After looking again I found this little Library, that works on files, too: https://github.com/Eonil/FileSystemEvents
这篇关于如何在Swift中使用文件系统事件API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!