Project: titanium
Issue TIMOB-18998: iOS9: App thinning: Create XCAssets (imagesets) w/ the cli and access resources within those catalogs at runtime
The first stage of app thinning support is to correctly sort out graphic assets by their associated targets and scale factor (1x,2x,3x | iphone, ipad). This is already supported at the file level to some extent with the proxies loading files with the appropriate file names flags on a particular device. This is a two part improvement and as more information is gained from apple, split into appropriate tickets. Apple will be documenting the XCAsset Source Artifact Format (basically a folder with JSON markup - Content.json) that will allow the cli to gather in project resources and create the needed imageset. The proxies will need to be able to access the assets located within the asset catalogs at runtime. *Reference*: https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html *Note*: Filenames with suffix 2x, 3x etc will still work in runtime. However, Apple will not slice the app into variants according to this naming convention. These files *must be inside asset catalogs* in order for app thinning to work. h4. Attached screenshot of how to get to use App Thinning. These are the steps to reproduce on Xcode 7 Beta2: 1. Archive your app in Xcode 7 Beta2. This archive will still be full sized. 2. Select archive and choose to export. 3. Choose last option to export ipa file for development use. 4. This screen will appear and you can choose specific device. 5. After export, show package contents of ipa and you can see a Assets.car file that contains the images. As compared to not using App thinning, you won't see the car file but instead your image files. h4. Some More Reference: _AssetCatalog Folder looks like this_ {quote} Media.xcassets -- fullscreen.imageset ---- fullscreen.png ---- fullscreen@2x.png ---- fullscreen@2x~ipad.png ---- etc. ---- Contents.json -- titleImage.imageset ---- titleImage.png ---- titleImage@2x.png ---- titleImage@3x.png ---- etc ---- Contents.json -- Contents.json {quote} _Contents.json file looks like this_ {code} { "images" : [ { "idiom" : "universal", "filename" : "fullscreen.png", "scale" : "1x" }, { "idiom" : "universal", "filename" : "fullscreen@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "fullscreen@3x.png", "scale" : "3x" }, { "idiom" : "iphone", "filename" : "fullscreen~iphone.png", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "fullscreen@2x~iphone.png", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" }, { "idiom" : "ipad", "filename" : "fullscreen~ipad.png", "scale" : "1x" }, { "idiom" : "ipad", "filename" : "fullscreen@2x~ipad.png", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } {code}
Story points: 34