English Version
Or you can directly go to my github page for further infomation.
ExtensionList 現(xiàn)已上架Bigboss源. 戳這里
Reveal2Loader也已上架,戳這里
Reveal升級(jí)2.0之后可以看Plugins,但是RevealLoader配合Applist只能看到用戶安裝的App,因此抽時(shí)間仿照Applist寫(xiě)了ExtensionList并且開(kāi)源。順便重寫(xiě)了下RevealLoader,也開(kāi)源在Reveal2Loader。
ExtensionList
ExtensionList使用的是LSApplicationWorkspace的installedPlugins函數(shù)來(lái)獲取所有安裝的Plugin,其中包含Today Widget, AppleWatch App等各種App Extension,并支持predicate過(guò)濾。
詳細(xì)用法可以參考Applist的使用說(shuō)明。
ALSectionDescriptors
avaliable-extensions
ExtensionList移除了ALSectionDescriptors字段suppress-hidden-apps參數(shù)。并增加了avaliable-extensions的BOOL屬性,用于過(guò)濾系統(tǒng)版本要求高于當(dāng)前設(shè)備iOS版本的Plugin。默認(rèn)值是true。predicate
ExtensionList獲取到的是LSPlugInKitProxy實(shí)例的數(shù)組,predicate是針對(duì)這個(gè)類的屬性進(jìn)行過(guò)濾。LSPlugInKitProxy其中一個(gè)屬性是protocol,對(duì)應(yīng)的是iOS私有服務(wù)的ID。如你需要過(guò)濾today extension,就可以在predicate字段寫(xiě)入protocol contains 'com.apple.widget-extension'。
關(guān)于App Extension的類型,以及對(duì)應(yīng)的ID,可以參考官網(wǎng)文檔,或者看extension(*.appex)對(duì)應(yīng)的
Info.plist中的NSExtensionPointIdentifier字段。
- A demo of
ALSectionDescriptors
ALSectionDescriptors = (
{
title = "Custom Keyboard";
predicate = "protocol contains 'keyboard-service'";
"icon-size" = 29;
"cell-class-name" = ELSwitchCell;
"avaliable-extensions" = 0;
},
)
Reveal2Loader
內(nèi)置了一個(gè)RevealServer-2的framework。路徑在/Library/Frameworks/RevealServer.framework,可以自己替換。
這個(gè)沒(méi)什么好說(shuō),只是改了下PreferenceLoader目錄下的plist。