R2ACConverter

Convert `R.image` with `ImageResources` for Xcode 15

MIT License

Stars
3

R2ACConverter

R2ACConverter is a simple converter from R.swift to Asset Catalog for Xcode 15.

Its name is came from Rswiftresources to Asset Catalog

Example

R.image

before after
R.image.foo() UIImage(resource: .foo)
R.image.bar()! UIImage(resource: .bar)
UIImage(resource: R.image.baz) UIImage(resource: .baz)
Image(R.image.qux) Image(.qux)
Image(uiImage: R.image.quux()!) Image(.quux)
Image(uiImage: UIImage(resource: R.image.corge)!) Image(.corge)

R.color

before after
R.color.foo() UIColor(resource: .foo)
R.color.bar()! UIColor(resource: .bar)
UIColor(resource: R.color.baz) UIColor(resource: .baz)
Color(R.color.qux) Color(.qux)
Color(uiColor: R.color.quux()!) Color(.quux)
Color(uiColor: UIColor(resource: R.color.corge)!) Color(.corge)

Requirement

  • macOS 13+
  • Xcode 15+
  • Swift 5.9+

Installation

Mint

mint install 417-72KI/R2ACConverter

Homebrew

brew install 417-72KI/tap/r2acconverter

Usage

$ r2acconverter /path/to/project
Badges
Extracted from project README
Actions Status GitHub release SwiftPM Compatible Platform GitHub license
Related Projects