Skip to content
.xcassets parser written in Swift
Swift Ruby Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Resources
Sources/XCAssetsKit
Tests/XCAssetsKitTests Add assetType property to Asset Aug 12, 2019
.gitignore Update .gitignore Jul 13, 2019
.swift-version
.travis.yml
LICENSE
Makefile Add Makefile Jul 13, 2019
Package.swift
README.md
XCAssetsKit.podspec Bump version up to 0.0.4 Oct 5, 2019

README.md

Header

Build Status Pods Version Swift

XCAssetsKit

.xcassets parser written in Swift 🐧

Usage

    let xcassets: XCAssets = try! XCAssets(fileURL: URL(fileURLWithPath: "path/to/file.xcassets"))

    let contents: XCAssetsContents = xcassets.contents // Decode Contents.json
    let assets: [Assets] = xcassets.assets // Decode Assets
    
    if case .imageSet(let imageSet) == assets[0] {
        print(imageSet.fileName) // image_png
        print(imageSet.contents.images.count) // 3

        print(imageSet.contents.images[0].filename) // Optional("Artboard.png")
        print(imageSet.contents.images[0].scale) // Optional("1x")

        print(imageSet.contents.images[1].filename) // Optional("Artboard@2x.png")
        print(imageSet.contents.images[1].scale) // Optional("2x")

        print(imageSet.contents.images[2].filename) // Optional("Artboard@3x.png")
        print(imageSet.contents.images[2].scale) // Optional("3x")
    }

Supported Assets

  • folder
  • imageset
  • colorset
  • dataset
  • textureset
  • mipmapset
  • cubetextureset
  • appiconset
  • appiconset
  • launchimage
  • brandassets
  • appiconset
  • iconset
  • stickericonset
  • arresorucegroup
  • arreferenceimage
  • arobject
  • complicationset
  • imagestack
  • imagestacklayer
  • spriteatlas
  • gcdashboardimage
  • gcleaderboard
  • gcleaderboardSet
  • stickerpack
  • sticker
  • stickersequence

License

XCAssetsKit is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.