FloatingFilter
SwiftPM Support & configurable filters
在应用程序模式浮动窗口中显示内容,用户可以通过提前输入进行模糊过滤。它的风格大致与浮动聚光灯窗口相匹配。
该列表使用默认的NSTableView
样式,因此它在 Big Sur 和旧版 macOS 版本上看起来很舒服!
该模块致力于尽可能照顾其组件的内存。这意味着您不需要保留对窗口或其控制器的引用。行动完成后,两人都会被释放。
如果您想要过滤有限的文件集合(例如“最近的文件”)或显示已知宏的列表,这非常有用。
import FloatingFilter
// ...
let items = [
Item ( identifier : UUID ( ) , title : " Create new widget " ) ,
Item ( identifier : 202002200930 , title : " Open last document " ) ,
Item ( identifier : " custom-ID_123 " , title : " Show downloaded data " )
]
FloatingFilterModule . showFilterWindow ( items : items ) { selectedItems in
print ( " Selected: " , selectedItems . map { $0 . title } )
}
将其添加到您的Cartfile
中:
github "cleancocoa/FloatingFilter"
然后运行
$ carthage update
...并在您的应用程序中包含来自Carthage/Build/Mac
的FloatingFilter.framework
。
版权所有 (c) 2020 克里斯蒂安·蒂茨。根据 MIT 许可证分发。
模糊匹配版权所有 (c) 2015 张一驰 https://github.com/yichizhang/SwiftyStringScore