Autocomplete resources like images, fonts and segues in Swift projects.
let myImage = UIImage(named: "MyImage")
let rImage = R.image.myImage()
let myColor = UIColor(named: "myColor")
let rColor = R.color.myColor
let myString = String(format: NSLocalizedString("Hello", comment: ""))
let rString = R.string.localizable.hello()
pod ‘R.swift’
The reason for is that the library will generate a R.generated.swift file, which will have all the properties that reference the assets used in our app. We want it generated before the app compiles all the files.
if [ $ACTION != "indexbuild" ]; then
"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"
fi