草庐IT

CGWindowListOption

全部标签

objective-c - MacOS - 按最近使用的优先顺序获取正在运行的应用程序

使用Swift(或objective-C)我想获取当前在macOS上运行的应用程序列表,按最近使用的顺序这就是cmd-选项卡显示Mac上的应用程序图标。以下为我提供了应用程序,但不是按照我想要的顺序。letapps=NSWorkspace.shared.runningApplications在documentationforthe.runningAppsproperty,它说:Theorderofthearrayisunspecified,butitisstable,meaningthattherelativeorderofparticularappswillnotchangeacro