Converting images folder to Images.xcassets and corresponding swift code. Image file names must end with scale, like ic_jike@2x.png.
- To generate Images.xcassets and code from given images folder, run:
swift GenerateAssetsAndCode.swift -i Images -assetsOutput Output/Images.xcassets -codeOutput Output
- Drag Images.xcassets and R.generated.swift to your project
- In your code:
let imageView = UIImageView(image: R.images.ic_jike)