简体   繁体   中英

How to use R.swift for string and colors

So I have a simple question.I searched a lot and there was no such a clear answer to my question. How can I use R.swfit for Colors and Localized String ? R.swift completely recognize my images and fonts but how can I use them for my Colors and Localized. I have so many colors and Localized String in my Project but R.string and R.color are empty at all

I found the answer.I was wrong about working of R.swift.for using Colors you have to define them in Assets.xcassets as a new color set.after creating colors there you can use them via R.color . for using R.string you have to create new File.string file into your project and try to define string in key-value form like "variable" = "something" .after that you can use R.string.File.variable() for using that string

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM